renamed netclient create_interface to set_interface_master to better describe its purpose

This commit is contained in:
Blake Harnden 2020-05-29 22:07:50 -07:00
parent 10fd844397
commit 8ad3f7961a
3 changed files with 7 additions and 8 deletions

View file

@ -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)

View file

@ -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.

View file

@ -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:
"""