summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/interface.py
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-03-23 11:50:22 +0000
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-03-23 11:50:22 +0000
commit193d0f416807b3eb5980dcf209e93774282b85f3 (patch)
tree1e7a2597872b04bc8e5af69d32a33b8b7ce4c4e8 /python/vyos/ifconfig/interface.py
parentf71a7461e44a98e862810bed3d0b9d280ee5dae0 (diff)
downloadvyos-1x-193d0f416807b3eb5980dcf209e93774282b85f3.tar.gz
vyos-1x-193d0f416807b3eb5980dcf209e93774282b85f3.zip
ifconfig: T31: convert all interface to set_vrf api
Diffstat (limited to 'python/vyos/ifconfig/interface.py')
-rw-r--r--python/vyos/ifconfig/interface.py25
1 files changed, 5 insertions, 20 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 9de24d729..718fe93db 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -85,12 +85,6 @@ class Interface(Control):
'validate': assert_mac,
'shellcmd': 'ip link set dev {ifname} address {value}',
},
- 'add_vrf': {
- 'shellcmd': 'ip link set dev {ifname} master {value}',
- },
- 'del_vrf': {
- 'shellcmd': 'ip link set dev {ifname} nomaster',
- },
'vrf': {
'force': True,
'convert': lambda v: f'master {v}' if v else 'nomaster',
@@ -303,25 +297,16 @@ class Interface(Control):
"""
self.set_interface('mac', mac)
- def add_vrf(self, vrf):
- """
- Add interface to given VRF instance.
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> Interface('eth0').add_vrf('foo')
- """
- self.set_interface('add_vrf', vrf)
-
- def del_vrf(self, vrf=''):
+ def set_vrf(self, vrf=''):
"""
- Remove interface from given VRF instance.
+ Add/Remove interface from given VRF instance.
Example:
>>> from vyos.ifconfig import Interface
- >>> Interface('eth0').del_vrf('foo')
+ >>> Interface('eth0').set_vrf('foo')
+ >>> Interface('eth0').set_vrf()
"""
- self.set_interface('del_vrf', vrf)
+ self.set_interface('vrf', vrf)
def set_arp_cache_tmo(self, tmo):
"""