summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-24 17:07:33 +0200
committerChristian Poessinger <christian@poessinger.com>2020-10-24 17:13:14 +0200
commit8e6f65b9f045cf2d22daa791bebd9931d51050bd (patch)
tree8d3fba3f93deaf0c047dc07290027320182f95cb /python
parent8c31bbe2af5e8209a2d2a10d3c803b67cc8bc5eb (diff)
downloadvyos-1x-8e6f65b9f045cf2d22daa791bebd9931d51050bd.tar.gz
vyos-1x-8e6f65b9f045cf2d22daa791bebd9931d51050bd.zip
vyos.util: drop obsolete function ifname_from_config()
Diffstat (limited to 'python')
-rw-r--r--python/vyos/util.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index 9d87e777a..e3e389baf 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -581,30 +581,6 @@ def get_half_cpus():
cpu /= 2
return int(cpu)
-def ifname_from_config(conf):
- """
- Gets interface name with VLANs from current config level.
- Level must be at the interface whose name we want.
-
- Example:
- >>> from vyos.util import ifname_from_config
- >>> from vyos.config import Config
- >>> conf = Config()
- >>> conf.set_level('interfaces ethernet eth0 vif-s 1 vif-c 2')
- >>> ifname_from_config(conf)
- 'eth0.1.2'
- """
- level = conf.get_level()
-
- # vlans
- if level[-2] == 'vif' or level[-2] == 'vif-s':
- return level[-3] + '.' + level[-1]
- if level[-2] == 'vif-c':
- return level[-5] + '.' + level[-3] + '.' + level[-1]
-
- # no vlans
- return level[-1]
-
def check_kmod(k_mod):
""" Common utility function to load required kernel modules on demand """
from vyos import ConfigError