summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorsrividya0208 <68350089+srividya0208@users.noreply.github.com>2020-07-18 01:50:17 -0500
committerGitHub <noreply@github.com>2020-07-18 08:50:17 +0200
commit6897aaf40e321cb585b299a75085f75666b5f816 (patch)
tree89f71d7a499950ee586b2574b4629ecd66bde4b1 /python
parentfc5c2d59ecc97d782deaf9d029c07990d15c8bb4 (diff)
downloadvyos-1x-6897aaf40e321cb585b299a75085f75666b5f816.tar.gz
vyos-1x-6897aaf40e321cb585b299a75085f75666b5f816.zip
vyos.ifconfig: T2673: Fix admin state if the mac address is changed for an interface
Changes are made in the interface.py script in order to bring the admin state to 'UP' after the mac is manually added in system config.The script is marking the interface from up to down state(as the MAC address can only be changed if interface is in 'down' state) but it is not bringing it up after the change
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/interface.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 1819ffc82..c73a3bbf8 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -322,7 +322,11 @@ class Interface(Control):
self.set_admin_state('down')
self.set_interface('mac', mac)
-
+
+ # Turn an interface to the 'up' state if it was changed to 'down' by this fucntion
+ if prev_state == 'up':
+ self.set_admin_state('up')
+
def set_vrf(self, vrf=''):
"""
Add/Remove interface from given VRF instance.