1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons: vlan: raw-device: check if cache value is valid before more checks

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2018-08-10 11:40:47 +02:00
parent d4019ee902
commit 650dd90a6a

View File

@@ -136,7 +136,7 @@ class vlan(moduleBase):
user_vlan_raw_device = ifaceobj.get_attr_value_first('vlan-raw-device')
cached_vlan_raw_device = self.ipcmd.cache_get('link', [ifaceobj.name, 'link'])
if cached_vlan_raw_device != user_vlan_raw_device:
if cached_vlan_raw_device and cached_vlan_raw_device != user_vlan_raw_device:
raise Exception('%s: cannot change vlan-raw-device from %s to %s: operation not supported. '
'Please delete the device with \'ifdown %s\' and recreate it to apply the change.'
% (ifaceobj.name, cached_vlan_raw_device, user_vlan_raw_device, ifaceobj.name))