From 316483cbe18811c6eaea07d5b790094a5de45abe Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 9 Apr 2020 21:19:08 +0200 Subject: vxlan: pseudo-ethernet: T2260: convert link nodes to source-interface --- python/vyos/ifconfig/macvlan.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'python/vyos/ifconfig/macvlan.py') 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) -- cgit v1.2.3