コード例 #1
0
ファイル: net.py プロジェクト: nocl/calculate-3-lib
 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))
コード例 #2
0
ファイル: net.py プロジェクト: nocl/calculate-3-install
 def get(self):
     return map(lambda x:cidrToMask(getMask(x)),
            self.Get('os_install_net_interfaces'))