daemon: removed utils.make_tuple and last remaining usage

This commit is contained in:
Blake Harnden 2020-06-09 18:53:42 -07:00
parent d71d84fae7
commit f73c617ecf
2 changed files with 1 additions and 19 deletions

View file

@ -126,20 +126,15 @@ class PhysicalNode(CoreNodeBase):
netif.name = f"gt{ifindex}"
netif.node = self
self.addnetif(netif, ifindex)
# use a more reasonable name, e.g. "gt0" instead of "gt.56286.150"
if self.up:
self.net_client.device_down(netif.localname)
self.net_client.device_name(netif.localname, netif.name)
netif.localname = netif.name
if hwaddr:
self.sethwaddr(ifindex, hwaddr)
for addr in utils.make_tuple(addrlist):
for addr in addrlist:
self.addaddr(ifindex, addr)
if self.up:
self.net_client.device_up(netif.localname)

View file

@ -158,19 +158,6 @@ def which(command: str, required: bool) -> str:
return found_path
def make_tuple(obj: Generic[T]) -> Tuple[T]:
"""
Create a tuple from an object, or return the object itself.
:param obj: object to convert to a tuple
:return: converted tuple or the object itself
"""
if hasattr(obj, "__iter__"):
return tuple(obj)
else:
return (obj,)
def make_tuple_fromstr(s: str, value_type: Callable[[str], T]) -> Tuple[T]:
"""
Create a tuple from a string.