Skip to content

Commit a5e1135

Browse files
committed
fixes
1 parent 7bb1900 commit a5e1135

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

generators/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,9 @@ async def create_oob_connections(
959959
},
960960
)
961961

962+
# Save the cable first so it exists in the database
963+
await cable.save(allow_upsert=True)
964+
962965
# Set the connector relationship on both interfaces
963966
source_endpoint.connector = cable.id
964967
target_endpoint.connector = cable.id
@@ -969,9 +972,6 @@ async def create_oob_connections(
969972
batch.add(
970973
task=target_endpoint.save, allow_upsert=True, node=target_endpoint
971974
)
972-
batch.add(
973-
task=cable.save, allow_upsert=True, node=cable
974-
)
975975
try:
976976
async for node, _ in batch.execute():
977977
hfid_str = ' -> '.join(node.hfid) if isinstance(node.hfid, list) else str(node.hfid)

generators/generate_dc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,21 @@ async def create_fabric_peering(self) -> None:
182182
},
183183
)
184184

185+
# Save the cable first so it exists in the database
186+
await cable.save(allow_upsert=True)
187+
185188
# Set bidirectional connector relationship
186189
# This allows queries to traverse: interface → connector → cable → connected_endpoints
187190
source_endpoint.connector = cable.id
188191
target_endpoint.connector = cable.id
189192

190-
# Queue all objects for batch save
193+
# Queue interface saves for batch
191194
batch.add(
192195
task=source_endpoint.save, allow_upsert=True, node=source_endpoint
193196
)
194197
batch.add(
195198
task=target_endpoint.save, allow_upsert=True, node=target_endpoint
196199
)
197-
batch.add(
198-
task=cable.save, allow_upsert=True, node=cable
199-
)
200200

201201
# Execute batch and log results
202202
async for node, _ in batch.execute():

objects/dc/dc-arista-s.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ kind: Object
44
spec:
55
kind: TopologyDataCenter
66
data:
7-
- name: DC-3
7+
- name: DC-Arista
88
location: Frankfurt
9-
description: Frankfurt Data Center
9+
description: Arista Data Center with cEOS switches
1010
strategy: ospf-ibgp
1111
design: PHYSICAL DC ARISTA S
1212
emulation: true

objects/dc/dc-cisco-s-border-leafs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ kind: Object
44
spec:
55
kind: TopologyDataCenter
66
data:
7-
- name: DC-1
7+
- name: DC-Cisco-Border
88
location: Katowice
9-
description: Katowice Data Center
9+
description: Cisco Data Center with border leafs
1010
strategy: ospf-ibgp
1111
design: PHYSICAL DC CISCO S WITH BORDER LEAFS
1212
emulation: true

objects/dc/dc-cisco-s.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ kind: Object
44
spec:
55
kind: TopologyDataCenter
66
data:
7-
- name: DC-2
7+
- name: DC-Cisco
88
location: Munich
9-
description: Munich Data Center
9+
description: Cisco Data Center with Nexus switches
1010
strategy: ebgp-ibgp
1111
design: PHYSICAL DC CISCO S
1212
emulation: true

objects/dc/dc-juniper-s.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ kind: Object
44
spec:
55
kind: TopologyDataCenter
66
data:
7-
- name: DC-5
7+
- name: DC-Juniper
88
location: London
9-
description: London Data Center with Juniper QFX5220-32CD
9+
description: Juniper Data Center with Juniper QFX5220-32CD
1010
strategy: ospf-ibgp
1111
design: PHYSICAL DC JUNIPER S
1212
emulation: true

objects/dc/dc-sonic-border-leafs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ kind: Object
44
spec:
55
kind: TopologyDataCenter
66
data:
7-
- name: DC-4
7+
- name: DC-SONiC
88
location: Barcelona
9-
description: Barcelona Data Center 4
9+
description: SONiC Data Center with border leafs
1010
strategy: ebgp-ibgp
1111
design: PHYSICAL DC SONIC S WITH BORDER LEAFS
1212
emulation: true

0 commit comments

Comments
 (0)