Home › Forums › FABRIC General Questions and Discussion › Cannot iterate over interfaces on a network in FABlib v1.9.0
- This topic has 6 replies, 4 voices, and was last updated 1 day, 12 hours ago by
Nirmala Shenoy.
-
AuthorPosts
-
August 7, 2025 at 11:06 am #8783
The following code and FabLib calls worked in v1.8.0:
for network in slice.get_networks(): print("NETWORK:") print(f"\t{network}") for intf in network.get_interfaces(): print("INTERFACES:") print(f"\t{intf}")
But, when running in v1.9.0, intf is always a blank list. If you grab the interfaces directly (get_interfaces()), it works fine. I haven’t dug into the source code on GitHub yet, but I figured I’d ask first to see if I’m working with deprecated functions or something like that.
-
This topic was modified 2 days, 18 hours ago by
Peter Willis.
August 7, 2025 at 11:15 am #8785Hi Peter,
Possibly a bug, however, I tried doing this with my existing slice and it seems to work.
Is there a specific sequence in which you are running this code? Just trying to reproduce this on my end.
Code Snippet of my trials:
from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager from ipaddress import ip_address, IPv4Address, IPv6Address, IPv4Network, IPv6Network fablib = fablib_manager() slice = fablib.get_slice(slice_name) for nw in slice.get_networks(): print(nw) for ifc in slice.get_interfaces(): print(ifc)
Thanks,
Komal
P.S: we did roll out some improvements w.r.t to how often the interfaces are updated to limit the number of ssh connections.
-
This reply was modified 2 days, 18 hours ago by
Komal Thareja.
August 7, 2025 at 11:31 am #8787In my case, it’s specifically when iterating over the interfaces on a given network, so slice.get_interfaces() works fine, but nw.get_interfaces() and using that to iterate over the interfaces of nw would not work.
August 8, 2025 at 12:08 pm #8788hello Komal,
we are configuring IP addresses in an OSPF network. so the link that is common to a pair of nodes is given the same network address.
I tried the script with f
for ifc in slice.get_interfaces():
the addressing assignment is going wrong.
can you please suggest how we can fix this?
thanks
August 8, 2025 at 1:16 pm #8789Hi Nirmala,
Could you please try using the fablib from this branch: https://github.com/fabric-testbed/fabrictestbed-extensions/tree/rel1.9.1 ?
nw.get_interfaces() should work now.
I plan to push this main branch Monday. I’ll keep you posted.
Please let me know if this resolves the issue.
Thanks,
Komal
1 user thanked author for this post.
August 8, 2025 at 3:35 pm #8790I gave it a try and then went back to 1.9.0 to double-check. It is working as intended in 1.9.1. Thank you!
August 8, 2025 at 5:12 pm #8791thanks a lot Komal. peter checked it and looks like it worked. I will be trying it now .
-
This topic was modified 2 days, 18 hours ago by
-
AuthorPosts
- You must be logged in to reply to this topic.