|
|
|
@ -125,6 +125,23 @@ class fillVars(object, cl_base.glob_attr):
|
|
|
|
|
return self.Get('os_linux_shortname')
|
|
|
|
|
return hostname
|
|
|
|
|
|
|
|
|
|
# все ip
|
|
|
|
|
def get_os_net_ip(self):
|
|
|
|
|
"""все ip компьютера, разделитель запятая"""
|
|
|
|
|
IPs = []
|
|
|
|
|
netInterfaces=cl_utils.getdirlist("/sys/class/net/")
|
|
|
|
|
for i in netInterfaces:
|
|
|
|
|
res = self._runos("/sbin/ifconfig %s"%i)
|
|
|
|
|
if not res:
|
|
|
|
|
break
|
|
|
|
|
for line in res:
|
|
|
|
|
searchIP = re.search('addr:([0-9\.]+).+Bcast:', line)
|
|
|
|
|
if searchIP:
|
|
|
|
|
# ip адрес
|
|
|
|
|
ip = searchIP.groups()[0]
|
|
|
|
|
IPs.append(ip)
|
|
|
|
|
return ",".join(IPs)
|
|
|
|
|
|
|
|
|
|
# Разрешенные сети (в данном случае все сети)
|
|
|
|
|
def get_os_net_allow(self):
|
|
|
|
|
"""Разрешенные сети разделитель запятая"""
|
|
|
|
|