Skip to content

Commit

Permalink
Merge pull request #101 from fabric-testbed/hussamnasir-patch-1
Browse files Browse the repository at this point in the history
Update fim_helper.py
  • Loading branch information
kthare10 authored Jan 8, 2025
2 parents 96f6c80 + 8ca925d commit 8ddda92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fimutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This is a package of Information Model utilitied for FABRIC
for scanning different types of sites
"""
__VERSION__ = "1.8.0"
__VERSION__ = "1.8.1"
__version__ = __VERSION__
11 changes: 7 additions & 4 deletions fimutil/ralph/fim_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,12 @@ def site_to_fim(site: Site, address: str, config: Dict = None) -> SubstrateTopol
for d, p4idx in zip(dp_to_p4_ports, range(1, 8 + 1)):
sp = dp_ns.add_interface(name=d, itype=InterfaceType.TrunkPort,
node_id=dp_port_id(dp.name, d), stitch_node=False)
topo.add_link(name='l' + str(link_idx), ltype=LinkType.Patch,
interfaces=[p4.interfaces[f'p{p4idx}'], sp],
node_id=sp.node_id + '-DAC')
try:
topo.add_link(name='l' + str(link_idx), ltype=LinkType.Patch,
interfaces=[p4.interfaces[f'p{p4idx}'], sp],
node_id=sp.node_id + '-DAC')
except KeyError:
logging.info(f'P4 is not connected on port p{p4idx}')
link_idx += 1

return topo
Expand All @@ -596,4 +599,4 @@ def site_to_fim(site: Site, address: str, config: Dict = None) -> SubstrateTopol
site = Site(site_name='LBNL', ralph=ralph)
site.catalog()
topo = site_to_fim(site, '123 Frienship Street')
print(topo)
print(topo)

0 comments on commit 8ddda92

Please sign in to comment.