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

addons: vrf: ifquery fixes for vrf

Ticket: CM-10175
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb onto dell-s3000-02

This patch fixes inappropriate ifquery fails.
This patch also include a review comment update for addressvirtual.py
[CCR-4310], ticket: [CM-8658]
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
This commit is contained in:
Nikhil
2016-03-30 16:56:37 -07:00
parent 557a54af8c
commit 586535e8db
3 changed files with 6 additions and 6 deletions

View File

@ -244,7 +244,7 @@ class addressvirtual(moduleBase):
return True
mac = mac.lower()
try:
if int(mac.split(":")[0][1], 16) & 1 :
if int(mac.split(":")[0], 16) & 1 :
self.logger.error("%s: Multicast bit is set in the virtual mac address '%s'" %(ifaceobj.name, mac))
return False
return True

View File

@ -764,7 +764,7 @@ class vrf(moduleBase):
try:
master = self.ipcmd.link_get_master(ifaceobj.name)
if not master or master != vrf:
ifaceobjcurr.update_config_with_status('vrf', master, 1)
ifaceobjcurr.update_config_with_status('vrf', str(master), 1)
else:
ifaceobjcurr.update_config_with_status('vrf', master, 0)
except Exception, e:

View File

@ -116,9 +116,9 @@ class iproute2(utilsBase):
[linkCache.update_attrdict([ifname], linkattrs)
for ifname, linkattrs in linkout.items()]
def _addr_filter(self, addr, scope=None):
def _addr_filter(self, ifname, addr, scope=None):
default_addrs = ['127.0.0.1/8', '::1/128' , '0.0.0.0']
if addr in default_addrs:
if ifname == 'lo' and addr in default_addrs:
return True
if scope and scope == 'link':
return True
@ -158,14 +158,14 @@ class iproute2(utilsBase):
except KeyError:
linkout[ifname] = linkattrs
if citems[2] == 'inet':
if self._addr_filter(citems[3], scope=citems[5]):
if self._addr_filter(citems[3], ifname, scope=citems[5]):
continue
addrattrs = {}
addrattrs['scope'] = citems[5]
addrattrs['type'] = 'inet'
linkout[ifname]['addrs'][citems[3]] = addrattrs
elif citems[2] == 'inet6':
if self._addr_filter(citems[3], scope=citems[5]):
if self._addr_filter(citems[3], ifname, scope=citems[5]):
continue
if citems[5] == 'link': continue #skip 'link' addresses
addrattrs = {}