Skip to content

Commit 60e7cce

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 7237c13 + 2fea495 commit 60e7cce

File tree

7 files changed

+573
-79
lines changed

7 files changed

+573
-79
lines changed

generators/common.py

Lines changed: 271 additions & 32 deletions
Large diffs are not rendered by default.

scripts/bootstrap.py

Lines changed: 290 additions & 37 deletions
Large diffs are not rendered by default.

tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_compose_command() -> str:
4040
# Use local docker-compose.yml file
4141
if override_file.exists():
4242
return f"docker compose -p infrahub -f {local_compose_file} -f {override_file}"
43-
return f"docker compose -p infrahub -f {local_compose_file}"
43+
return f"docker compose -p infrahub-bundle-dc -f {local_compose_file}"
4444

4545
# Fall back to downloading from infrahub.opsmill.io
4646
# Determine the base URL based on edition

templates/configs/leafs/juniper_junos.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ protocols {
122122
{%- endfor %}
123123
{%- endif %}
124124

125-
{%- if bgp %}
126-
{%- for bgp_config in bgp %}
125+
{%- if bgp_profiles %}
126+
{%- for bgp_config in bgp_profiles %}
127127

128128
routing-options {
129129
{%- if bgp_config.router_id and bgp_config.router_id.address %}

templates/configs/spines/cisco_nxos.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ router ospf {{ ospf_config.process_id }}
5050
{%- endfor %}
5151
!
5252
! BGP Configuration
53-
{%- for bgp_config in bgp %}
53+
{%- for bgp_config in bgp_profiles %}
5454
router bgp {{ bgp_config.local_as.asn }}
5555
router-id {{ bgp_config.router_id.address.split('/')[0] }}
5656
{%- if bgp_config.graceful_restart %}

transforms/leaf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ async def transform(self, data: Any) -> Any:
4040
# Extract first OSPF config or use empty dict
4141
ospf = ospf_configs[0] if ospf_configs else {}
4242

43-
# Restructure BGP data for template
44-
# Template expects: bgp.local_as, bgp.router_id, bgp.neighbors
43+
# Create both flattened BGP dict (for Arista/Cisco templates)
44+
# and pass original bgp_profiles list (for Juniper template)
4545
bgp = {}
4646
if bgp_profiles:
4747
# Get common BGP settings from first profile
@@ -67,7 +67,8 @@ async def transform(self, data: Any) -> Any:
6767

6868
config = {
6969
"hostname": data.get("name"),
70-
"bgp": bgp,
70+
"bgp": bgp, # Flattened dict for Arista/Cisco/SONiC templates
71+
"bgp_profiles": bgp_profiles, # Original list for Juniper template
7172
"ospf": ospf,
7273
"interfaces": get_interface_roles(data.get("interfaces")),
7374
"vlans": get_vlans(data.get("interfaces")),

transforms/spine.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ async def transform(self, data: Any) -> Any:
4242
# Extract first OSPF config or use empty dict
4343
ospf = ospf_configs[0] if ospf_configs else {}
4444

45-
# Restructure BGP data for template
46-
# Template expects: bgp.local_as, bgp.router_id, bgp.neighbors
45+
# Create both flattened BGP dict (for Arista/Juniper templates)
46+
# and pass original bgp_profiles list (for Cisco template)
4747
bgp = {}
4848
if bgp_profiles:
4949
# Get common BGP settings from first profile
@@ -69,7 +69,8 @@ async def transform(self, data: Any) -> Any:
6969

7070
config = {
7171
"hostname": data.get("name"),
72-
"bgp": bgp,
72+
"bgp": bgp, # Flattened dict for Arista/Juniper/SONiC templates
73+
"bgp_profiles": bgp_profiles, # Original list for Cisco template
7374
"ospf": ospf,
7475
"interface_roles": get_interface_roles(data.get("interfaces")),
7576
"loopbacks": get_loopbacks(data.get("interfaces")),

0 commit comments

Comments
 (0)