diff options
author | Christian Breunig <christian@breunig.cc> | 2024-05-02 21:04:30 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-05-02 21:04:30 +0200 |
commit | dd40ed58b9e50d40cd395e67be3e9bccfb89e1f6 (patch) | |
tree | 65912073e72ab37fabd79346a5acdbd0dfd29ac9 /python/vyos/ifconfig/interface.py | |
parent | dd92f14b9d70956c6604f8fbbce0950f6d6c8a1d (diff) | |
download | vyos-1x-dd40ed58b9e50d40cd395e67be3e9bccfb89e1f6.tar.gz vyos-1x-dd40ed58b9e50d40cd395e67be3e9bccfb89e1f6.zip |
netns: T6295: disable incomplete support in VyOS 1.4 sagitta
The netns support currently available on the VyOS CLI is only a
proof-of-technology, we have no real support for any service behind it.
In order to not confuse anyone on the LTS branch we decided to remove the
netns option for interfaces until there is a proper usecase and implementation
available.
Diffstat (limited to 'python/vyos/ifconfig/interface.py')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index f295c1066..fbbc04532 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -36,7 +36,6 @@ from vyos.template import render from vyos.utils.network import mac2eui64 from vyos.utils.dict import dict_search from vyos.utils.network import get_interface_config -from vyos.utils.network import get_interface_namespace from vyos.utils.process import is_systemd_service_active from vyos.template import is_ipv4 from vyos.template import is_ipv6 @@ -137,9 +136,6 @@ class Interface(Control): 'validate': assert_mtu, 'shellcmd': 'ip link set dev {ifname} mtu {value}', }, - 'netns': { - 'shellcmd': 'ip link set dev {ifname} netns {value}', - }, 'vrf': { 'convert': lambda v: f'master {v}' if v else 'nomaster', 'shellcmd': 'ip link set dev {ifname} {value}', @@ -538,35 +534,6 @@ class Interface(Control): if prev_state == 'up': self.set_admin_state('up') - def del_netns(self, netns): - """ - Remove interface from given NETNS. - """ - - # If NETNS does not exist then there is nothing to delete - if not os.path.exists(f'/run/netns/{netns}'): - return None - - # As a PoC we only allow 'dummy' interfaces - if 'dum' not in self.ifname: - return None - - # Check if interface realy exists in namespace - if get_interface_namespace(self.ifname) != None: - self._cmd(f'ip netns exec {get_interface_namespace(self.ifname)} ip link del dev {self.ifname}') - return - - def set_netns(self, netns): - """ - Add interface from given NETNS. - - Example: - >>> from vyos.ifconfig import Interface - >>> Interface('dum0').set_netns('foo') - """ - - self.set_interface('netns', netns) - def get_vrf(self): """ Get VRF from interface @@ -1489,16 +1456,6 @@ class Interface(Control): if mac: self.set_mac(mac) - # If interface is connected to NETNS we don't have to check all other - # settings like MTU/IPv6/sysctl values, etc. - # Since the interface is pushed onto a separate logical stack - # Configure NETNS - if dict_search('netns', config) != None: - self.set_netns(config.get('netns', '')) - return - else: - self.del_netns(config.get('netns', '')) - # Update interface description self.set_alias(config.get('description', '')) |