From f50f16fa71a122a0b2f6207d7f80446e34331fd9 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 8 Apr 2016 15:59:42 -0700 Subject: [PATCH] addons: vxlan: fix ifquery --check failure on vxlan-svcnodeip Ticket: CM-10336 Reviewed By: Roopa Prabhu Testing Done: yes, by installing ifupdown .deb file onto dell-s3000-02 Signed-off-by: Nikhil --- addons/vxlan.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/vxlan.py b/addons/vxlan.py index e7e5d57..12ba318 100644 --- a/addons/vxlan.py +++ b/addons/vxlan.py @@ -76,8 +76,10 @@ class vxlan(moduleBase): except Exception, e: self.log_warn(str(e)) - def _query_check_n_update(self, ifaceobjcurr, attrname, attrval, + def _query_check_n_update(self, ifaceobj, ifaceobjcurr, attrname, attrval, running_attrval): + if not ifaceobj.get_attr_value_first(attrname): + return if running_attrval and attrval == running_attrval: ifaceobjcurr.update_config_with_status(attrname, attrval, 0) else: @@ -105,7 +107,7 @@ class vxlan(moduleBase): ifaceobjcurr.check_n_update_config_with_status_many(ifaceobj, self.get_mod_attrs(), -1) return - self._query_check_n_update(ifaceobjcurr, 'vxlan-id', + self._query_check_n_update(ifaceobj, ifaceobjcurr, 'vxlan-id', ifaceobj.get_attr_value_first('vxlan-id'), vxlanattrs.get('vxlanid')) @@ -114,16 +116,16 @@ class vxlan(moduleBase): if running_attrval == self._clagd_vxlan_anycast_ip: # if local ip is anycast_ip, then let query_check to go through attrval = self._clagd_vxlan_anycast_ip - self._query_check_n_update(ifaceobjcurr, 'vxlan-local-tunnelip', + self._query_check_n_update(ifaceobj, ifaceobjcurr, 'vxlan-local-tunnelip', attrval, running_attrval) - self._query_check_n_update(ifaceobjcurr, 'vxlan-svcnodeip', + self._query_check_n_update(ifaceobj, ifaceobjcurr, 'vxlan-svcnodeip', ifaceobj.get_attr_value_first('vxlan-svcnodeip'), vxlanattrs.get('svcnode')) if not systemUtils.is_service_running(None, '/var/run/vxrd.pid'): # vxlan-remoteip config is allowed only if vxrd is not running - self._query_check_n_update_addresses(ifaceobjcurr, 'vxlan-remoteip', + self._query_check_n_update_addresses(ifaceobj, ifaceobjcurr, 'vxlan-remoteip', ifaceobj.get_attr_value('vxlan-remoteip'), vxlanattrs.get('remote', [])) @@ -140,7 +142,7 @@ class vxlan(moduleBase): ageing = ifaceobj.get_attr_value_first('vxlan-ageing') if not ageing: ageing = self.get_mod_subattr('vxlan-ageing', 'default') - self._query_check_n_update(ifaceobjcurr, 'vxlan-ageing', + self._query_check_n_update(ifaceobj, ifaceobjcurr, 'vxlan-ageing', ageing, vxlanattrs.get('ageing')) def _query_running(self, ifaceobjrunning):