diff --git a/daemon/core/emulator/distributed.py b/daemon/core/emulator/distributed.py index 4e7fcdde..5f188cb0 100644 --- a/daemon/core/emulator/distributed.py +++ b/daemon/core/emulator/distributed.py @@ -212,7 +212,7 @@ class DistributedController: "local tunnel node(%s) to remote(%s) key(%s)", node.name, host, key ) local_tap = GreTap(session=self.session, remoteip=host, key=key) - local_tap.net_client.create_interface(node.brname, local_tap.localname) + local_tap.net_client.set_interface_master(node.brname, local_tap.localname) # server to local logging.info( @@ -221,7 +221,7 @@ class DistributedController: remote_tap = GreTap( session=self.session, remoteip=self.address, key=key, server=server ) - remote_tap.net_client.create_interface(node.brname, remote_tap.localname) + remote_tap.net_client.set_interface_master(node.brname, remote_tap.localname) # save tunnels for shutdown tunnel = (local_tap, remote_tap) diff --git a/daemon/core/nodes/netclient.py b/daemon/core/nodes/netclient.py index 51ac075e..091938de 100644 --- a/daemon/core/nodes/netclient.py +++ b/daemon/core/nodes/netclient.py @@ -251,7 +251,7 @@ class LinuxNetClient: self.device_down(name) self.run(f"{IP_BIN} link delete {name} type bridge") - def create_interface(self, bridge_name: str, interface_name: str) -> None: + def set_interface_master(self, bridge_name: str, interface_name: str) -> None: """ Assign interface master to a Linux bridge. @@ -330,7 +330,7 @@ class OvsNetClient(LinuxNetClient): self.device_down(name) self.run(f"{OVS_BIN} del-br {name}") - def create_interface(self, bridge_name: str, interface_name: str) -> None: + def set_interface_master(self, bridge_name: str, interface_name: str) -> None: """ Create an interface associated with a network bridge. diff --git a/daemon/core/nodes/network.py b/daemon/core/nodes/network.py index 973346ad..f0b2fefa 100644 --- a/daemon/core/nodes/network.py +++ b/daemon/core/nodes/network.py @@ -360,7 +360,7 @@ class CoreNetwork(CoreNetworkBase): :return: nothing """ if self.up: - netif.net_client.create_interface(self.brname, netif.localname) + netif.net_client.set_interface_master(self.brname, netif.localname) super().attach(netif) def detach(self, netif: CoreInterface) -> None: @@ -557,8 +557,7 @@ class CoreNetwork(CoreNetworkBase): netif = Veth(self.session, None, name, localname, start=self.up) self.attach(netif) if net.up and net.brname: - # this is similar to net.attach() but uses netif.name instead of localname - netif.net_client.create_interface(net.brname, netif.name) + netif.net_client.set_interface_master(net.brname, netif.name) i = net.newifindex() net._netif[i] = netif with net._linked_lock: @@ -807,7 +806,7 @@ class CtrlNet(CoreNetwork): self.host_cmd(f"{self.updown_script} {self.brname} startup") if self.serverintf: - self.net_client.create_interface(self.brname, self.serverintf) + self.net_client.set_interface_master(self.brname, self.serverintf) def shutdown(self) -> None: """