Fix detect network by ip and mask if ip and mask absent.

master
Mike Hiretsky 13 years ago
parent 78c3cb98a3
commit 6543d651d3

@ -121,7 +121,10 @@ class fillVars(object, glob_attr):
mapInterface = {}
mapInterface["ip"] = ipaddr
mapInterface["cidr"] = str(ip.maskToCidr(mask)) if mask else ""
mapInterface["network"] = ip.getIpNet(ipaddr,mask=mask)
if ipaddr and mask:
mapInterface["network"] = ip.getIpNet(ipaddr,mask=mask)
else:
mapInterface["network"] = ""
mapInterface["dhcp"] = "on" if dhcp else "off"
mapInterface["mac"] = mac
mapInterface["name"] = "{vendor} {name}".format(**pciInfo)

Loading…
Cancel
Save