summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-09 21:19:08 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-09 21:19:08 +0200
commit316483cbe18811c6eaea07d5b790094a5de45abe (patch)
treef693a523f93c1f322d09157bf93fc7fd62d3a503 /python/vyos
parent0f0f93983bdc350d1dec58bf1555fffba39b6d3a (diff)
downloadvyos-1x-316483cbe18811c6eaea07d5b790094a5de45abe.tar.gz
vyos-1x-316483cbe18811c6eaea07d5b790094a5de45abe.zip
vxlan: pseudo-ethernet: T2260: convert link nodes to source-interface
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/ifconfig/macvlan.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/python/vyos/ifconfig/macvlan.py b/python/vyos/ifconfig/macvlan.py
index 4e4b563a1..55b1a3e91 100644
--- a/python/vyos/ifconfig/macvlan.py
+++ b/python/vyos/ifconfig/macvlan.py
@@ -35,10 +35,10 @@ class MACVLANIf(Interface):
'prefixes': ['peth', ],
},
}
- options = Interface.options + ['link', 'mode']
+ options = Interface.options + ['source_interface', 'mode']
def _create(self):
- cmd = 'ip link add {ifname} link {link} type macvlan mode {mode}'.format(
+ cmd = 'ip link add {ifname} link {source_interface} type macvlan mode {mode}'.format(
**self.config)
self._cmd(cmd)
@@ -54,7 +54,7 @@ class MACVLANIf(Interface):
"""
config = {
'address': '',
- 'link': 0,
+ 'source_interface': '',
'mode': ''
}
return config
@@ -62,7 +62,6 @@ class MACVLANIf(Interface):
def set_mode(self, mode):
"""
"""
-
- cmd = 'ip link set dev {} type macvlan mode {}'.format(
- self.config['ifname'], mode)
+ ifname = self.config['ifname']
+ cmd = f'ip link set dev {ifname} type macvlan mode {mode}'
return self._cmd(cmd)