Example #1
0
 def get(self):
     """Allowed networks"""
     networks=[]
     netInterfaces=self.Get("os_net_interfaces")
     for i in netInterfaces:
         ipaddr, mask = ip.getIp(i),ip.cidrToMask(ip.getMask(i))
         if ipaddr and mask:
             networks.append(ip.getIpNet(ipaddr, mask))
         else:
             networks.append("")
     return ",".join(filter(lambda x:x,networks))
Example #2
0
 def convertCidrToMask(x):
     if x and x.isdigit() and int(x) in range(0,33):
         return cidrToMask(int(x))
     else:
         return x
Example #3
0
 def get(self):
     return map(lambda x:cidrToMask(getMask(x)),
            self.Get('os_install_net_interfaces'))