Пример #1
0
 def get_os_net_ip(self):
     """All computer ip addresses, comma delimeter"""
     IPs = []
     netInterfaces=self.Get("os_net_interfaces")
     for i in netInterfaces:
         ipaddr, mask = ip.receiveIpAndMask(i)
         if ipaddr:
             IPs.append(ipaddr)
     return ",".join(IPs)
Пример #2
0
 def get_os_net_allow(self):
     """Allowed networks"""
     networks=[]
     netInterfaces=self.Get("os_net_interfaces")
     for i in netInterfaces:
         ipaddr, mask = ip.receiveIpAndMask(i)
         if ipaddr and mask:
             networks.append(ip.getIpNet(ipaddr, mask))
         else:
             networks.append("")
     return ",".join(filter(lambda x:x,networks))