Skip to content

Commit

Permalink
minor fixes for adding/removing interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
abessiari committed Feb 5, 2024
1 parent 706cdfa commit 3541aeb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fabrictestbed_extensions/fablib/network_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,9 +988,13 @@ def get_interfaces(self) -> List[Interface]:
self.interfaces = []
for interface in self.get_fim_network_service().interface_list:
logging.debug(f"interface: {interface}")
self.interfaces.append(
self.get_slice().get_interface(name=interface.name)
)

try:
self.interfaces.append(
self.get_slice().get_interface(name=interface.name)
)
except:
logging.warning(f"interface not found: {interface.name}")

return self.interfaces

Expand Down Expand Up @@ -1190,6 +1194,9 @@ def set_allocated_ips(self, allocated_ips: dict[IPv4Address or IPv6Address]):
for ip in allocated_ips:
allocated_ips_strs.append(str(ip))

if "subnet" not in fablib_data:
fablib_data["subnet"] = {}

fablib_data["subnet"]["allocated_ips"] = allocated_ips_strs
self.set_fablib_data(fablib_data)

Expand Down

0 comments on commit 3541aeb

Please sign in to comment.