|
|
|
@ -62,12 +62,11 @@ class VariableOsNetAllow(ReadonlyVariable):
|
|
|
|
|
networks = []
|
|
|
|
|
net_interfaces = self.Get("os_net_interfaces")
|
|
|
|
|
for i in net_interfaces:
|
|
|
|
|
ipaddr, mask = ip.getIp(i), ip.cidrToMask(ip.getMask(i))
|
|
|
|
|
iface = ip.getMaster(i) or i
|
|
|
|
|
ipaddr, mask = ip.getIp(iface), ip.cidrToMask(ip.getMask(iface))
|
|
|
|
|
if ipaddr and mask:
|
|
|
|
|
networks.append(ip.getIpNet(ipaddr, mask))
|
|
|
|
|
else:
|
|
|
|
|
networks.append("")
|
|
|
|
|
return ",".join(filter(lambda x: x, networks))
|
|
|
|
|
return ",".join(list(set(filter(lambda x: x, networks))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsNetIp(ReadonlyVariable):
|
|
|
|
@ -80,10 +79,11 @@ class VariableOsNetIp(ReadonlyVariable):
|
|
|
|
|
ips = []
|
|
|
|
|
net_interfaces = self.Get("os_net_interfaces")
|
|
|
|
|
for i in net_interfaces:
|
|
|
|
|
ipaddr = ip.getIp(i)
|
|
|
|
|
iface = ip.getMaster(i) or i
|
|
|
|
|
ipaddr = ip.getIp(iface)
|
|
|
|
|
if ipaddr:
|
|
|
|
|
ips.append(ipaddr)
|
|
|
|
|
return ",".join(ips)
|
|
|
|
|
return ",".join(list(set(ips)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsNetInterfaces(ReadonlyVariable):
|
|
|
|
|