summaryrefslogtreecommitdiff
path: root/cloudinit/net/__init__.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-06-24 15:22:45 -0400
committerGitHub <noreply@github.com>2020-06-24 15:22:45 -0400
commit31b540524fd1dd5ae79bc703f581339fff1883e9 (patch)
treebd4cfade17f9df7b0b12d59b2bd5f8987058fb7f /cloudinit/net/__init__.py
parent9a97a3f24e196401a9c54e9c7977ef6a03c98aeb (diff)
downloadvyos-cloud-init-31b540524fd1dd5ae79bc703f581339fff1883e9.tar.gz
vyos-cloud-init-31b540524fd1dd5ae79bc703f581339fff1883e9.zip
net/networking: remove unused functions/methods (#453)
Namely, is_connected, is_wireless and is_present. None of these are used in the cloud-init codebase, so remove the dead code (instead of refactoring it).
Diffstat (limited to 'cloudinit/net/__init__.py')
-rw-r--r--cloudinit/net/__init__.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index b40cb154..fd5a1b3e 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -99,10 +99,6 @@ def is_up(devname):
return read_sys_net_safe(devname, "operstate", translate=translate)
-def is_wireless(devname):
- return os.path.exists(sys_dev_path(devname, "wireless"))
-
-
def is_bridge(devname):
return os.path.exists(sys_dev_path(devname, "bridge"))
@@ -266,28 +262,10 @@ def is_vlan(devname):
return 'DEVTYPE=vlan' in uevent.splitlines()
-def is_connected(devname):
- # is_connected isn't really as simple as that. 2 is
- # 'physically connected'. 3 is 'not connected'. but a wlan interface will
- # always show 3.
- iflink = read_sys_net_safe(devname, "iflink")
- if iflink == "2":
- return True
- if not is_wireless(devname):
- return False
- LOG.debug("'%s' is wireless, basing 'connected' on carrier", devname)
- return read_sys_net_safe(devname, "carrier",
- translate={'0': False, '1': True})
-
-
def is_physical(devname):
return os.path.exists(sys_dev_path(devname, "device"))
-def is_present(devname):
- return os.path.exists(sys_dev_path(devname))
-
-
def device_driver(devname):
"""Return the device driver for net device named 'devname'."""
driver = None