Skip to content

Commit

Permalink
ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed Mar 11, 2024
1 parent c04b4e5 commit f419fbd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion fabrictestbed_extensions/fablib/facility_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ def new_facility_port(
interfaces = []
index = 1
for v in vlan:
iface_tuple = (f"iface-{index}", Labels(vlan=v), Capacities(bw=bandwidth))
iface_tuple = (
f"iface-{index}",
Labels(vlan=v),
Capacities(bw=bandwidth),
)
interfaces.append(iface_tuple)
fim_facility_port = slice.get_fim_topology().add_facility(
name=name,
Expand Down
10 changes: 7 additions & 3 deletions fabrictestbed_extensions/fablib/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ class Interface:
ADDR = "addr"
CONFIG = "config"

def __init__(self, component: Component = None, fim_interface: FimInterface = None,
node: FacilityPort = None):
def __init__(
self,
component: Component = None,
fim_interface: FimInterface = None,
node: FacilityPort = None,
):
"""
.. note::
Expand Down Expand Up @@ -665,7 +669,7 @@ def get_slice(self) -> Slice:
"""
return self.get_node().get_slice()

def get_node(self) -> Union [Node, FacilityPort]:
def get_node(self) -> Union[Node, FacilityPort]:
"""
Gets the node this interface's component is on.
Expand Down
5 changes: 4 additions & 1 deletion fabrictestbed_extensions/fablib/network_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ def validate_nstype(type, interfaces):
nodes_per_site[node.get_site()] += 1
for interface in interfaces:
node = interface.get_node()
if interface.get_model() == "NIC_Basic" and nodes_per_site[node.get_site()] > 1:
if (
interface.get_model() == "NIC_Basic"
and nodes_per_site[node.get_site()] > 1
):
if node.get_host() is None:
exception_list.append(
f"Network type {type} does not support multiple NIC_Basic interfaces on VMs "
Expand Down

0 comments on commit f419fbd

Please sign in to comment.