|
|
|
@ -270,7 +270,13 @@ class fillVars(glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_os_net_domain(self):
|
|
|
|
|
'''Определим домен'''
|
|
|
|
|
domain=self._runos("hostname -d 2>&1")
|
|
|
|
|
textLines = self._runos("hostname -d 2>&1")
|
|
|
|
|
if textLines is False:
|
|
|
|
|
cl_overriding.printERROR(_("Error execute 'hostname -d'"))
|
|
|
|
|
cl_overriding.exit(1)
|
|
|
|
|
domain = ""
|
|
|
|
|
if textLines:
|
|
|
|
|
domain = textLines[0]
|
|
|
|
|
if not domain:
|
|
|
|
|
cl_overriding.printERROR(_("Error:") + " " +\
|
|
|
|
|
_("Not found domain name"))
|
|
|
|
@ -382,7 +388,10 @@ class fillVars(glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_from_uname():
|
|
|
|
|
"""Get version from uname"""
|
|
|
|
|
kernelVersion=self._runos("uname -r")
|
|
|
|
|
textLines = self._runos("uname -r")
|
|
|
|
|
kernelVersion = ""
|
|
|
|
|
if textLines:
|
|
|
|
|
kernelVersion = textLines[0]
|
|
|
|
|
if kernelVersion:
|
|
|
|
|
return kernelVersion.partition("-")[0]
|
|
|
|
|
return get_from_metapackage() or get_from_calculate_ini() or \
|
|
|
|
@ -390,18 +399,22 @@ class fillVars(glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_os_net_hostname(self):
|
|
|
|
|
'''Считать имя компьютера net_host'''
|
|
|
|
|
hostname=self._runos("hostname -s 2>&1")
|
|
|
|
|
if not hostname:
|
|
|
|
|
return ""
|
|
|
|
|
if re.search("^hostname: ",hostname):
|
|
|
|
|
hostname=self._runos("hostname 2>&1")
|
|
|
|
|
textLines = self._runos("hostname -s 2>&1")
|
|
|
|
|
hostname = ""
|
|
|
|
|
if textLines:
|
|
|
|
|
hostname = textLines[0]
|
|
|
|
|
if not hostname:
|
|
|
|
|
return ""
|
|
|
|
|
if re.search("^hostname: ",hostname):
|
|
|
|
|
return self.Get('os_linux_shortname')
|
|
|
|
|
else:
|
|
|
|
|
if hostname=='livecd':
|
|
|
|
|
if re.search("^hostname: ",hostname):
|
|
|
|
|
textLines = self._runos("hostname 2>&1")
|
|
|
|
|
if not textLines:
|
|
|
|
|
return ""
|
|
|
|
|
hostname = textLines[0]
|
|
|
|
|
if re.search("^hostname: ",hostname):
|
|
|
|
|
return self.Get('os_linux_shortname')
|
|
|
|
|
else:
|
|
|
|
|
if hostname=='livecd':
|
|
|
|
|
return self.Get('os_linux_shortname')
|
|
|
|
|
return hostname
|
|
|
|
|
|
|
|
|
|
# все ip
|
|
|
|
@ -465,9 +478,10 @@ class fillVars(glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_os_arch_machine(self):
|
|
|
|
|
"""архитектура процессора"""
|
|
|
|
|
march = self._runos("uname -m")
|
|
|
|
|
if not march:
|
|
|
|
|
textLines = self._runos("uname -m")
|
|
|
|
|
if not textLines:
|
|
|
|
|
return ""
|
|
|
|
|
march = textLines[0]
|
|
|
|
|
return march
|
|
|
|
|
|
|
|
|
|
def get_os_root_dev(self):
|
|
|
|
@ -846,15 +860,16 @@ class fillVars(glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_hr_laptop(self):
|
|
|
|
|
"""Если компьютер ноутбук, то его производитель"""
|
|
|
|
|
formfactor = self._runos("hal-get-property --udi \
|
|
|
|
|
textLines = self._runos("hal-get-property --udi \
|
|
|
|
|
/org/freedesktop/Hal/devices/computer --key system.formfactor")
|
|
|
|
|
if not formfactor:
|
|
|
|
|
if not textLines:
|
|
|
|
|
return ""
|
|
|
|
|
formfactor = textLines[0]
|
|
|
|
|
if formfactor == 'laptop':
|
|
|
|
|
vendor = self._runos("hal-get-property --udi \
|
|
|
|
|
textLines = self._runos("hal-get-property --udi \
|
|
|
|
|
/org/freedesktop/Hal/devices/computer --key system.hardware.vendor")
|
|
|
|
|
if vendor:
|
|
|
|
|
vendor = vendor.split(" ")[0]
|
|
|
|
|
if textLines:
|
|
|
|
|
vendor = textLines[0].split(" ")[0]
|
|
|
|
|
else:
|
|
|
|
|
vendor = "unknown"
|
|
|
|
|
return vendor.lower()
|
|
|
|
|