|
|
|
@ -1104,13 +1104,21 @@ class fillVars(object, glob_attr):
|
|
|
|
|
else:
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
def isDNSByDHCP(self):
|
|
|
|
|
"""If first interface get ip by DHCP dns must be DHCP"""
|
|
|
|
|
dhcps = self.Get('os_install_net_dhcp_set')
|
|
|
|
|
if dhcps:
|
|
|
|
|
if dhcps[0] == "on":
|
|
|
|
|
return True
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def get_os_install_net_dns(self):
|
|
|
|
|
"""Get current name servers"""
|
|
|
|
|
dnsIps = filter(ip.checkIp,
|
|
|
|
|
map(lambda x:x.strip().partition("nameserver")[2].strip(),
|
|
|
|
|
filter(lambda x:x.lstrip().startswith("nameserver"),
|
|
|
|
|
readLinesFile('/etc/resolv.conf'))))
|
|
|
|
|
return " ".join(dnsIps)
|
|
|
|
|
return "" if self.isDNSByDHCP() else " ".join(dnsIps)
|
|
|
|
|
|
|
|
|
|
def get_os_install_net_dns_search(self):
|
|
|
|
|
"""Get current name servers"""
|
|
|
|
@ -1118,7 +1126,7 @@ class fillVars(object, glob_attr):
|
|
|
|
|
map(lambda x:x.strip().partition("search")[2].strip(),
|
|
|
|
|
filter(lambda x:x.lstrip().startswith("search"),
|
|
|
|
|
readLinesFile('/etc/resolv.conf'))))
|
|
|
|
|
return dnsSearch
|
|
|
|
|
return "" if self.isDNSByDHCP() else dnsSearch
|
|
|
|
|
|
|
|
|
|
def get_os_install_net_conf(self):
|
|
|
|
|
"""Net setup (networkmanager or openrc)"""
|
|
|
|
|