daemon: removed utils.make_tuple and last remaining usage
This commit is contained in:
parent
d71d84fae7
commit
f73c617ecf
2 changed files with 1 additions and 19 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue