mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-dns-install does not exit on error
This patch fixes behavior of ipa-dns-install, which does not exit when an invalid configuration of /etc/hosts is detected. https://fedorahosted.org/freeipa/ticket/736
This commit is contained in:
parent
5768924710
commit
30fdafcfbe
@ -67,19 +67,24 @@ def resolve_host(host_name):
|
|||||||
try:
|
try:
|
||||||
addrinfos = socket.getaddrinfo(host_name, None,
|
addrinfos = socket.getaddrinfo(host_name, None,
|
||||||
socket.AF_UNSPEC, socket.SOCK_DGRAM)
|
socket.AF_UNSPEC, socket.SOCK_DGRAM)
|
||||||
for ai in addrinfos:
|
|
||||||
ip = ai[4][0]
|
|
||||||
if ip == "127.0.0.1" or ip == "::1":
|
|
||||||
print "The hostname resolves to the localhost address (127.0.0.1/::1)"
|
|
||||||
print "Please change your /etc/hosts file so that the hostname"
|
|
||||||
print "resolves to the ip address of your network interface."
|
|
||||||
print ""
|
|
||||||
print "Please fix your /etc/hosts file and restart the setup program"
|
|
||||||
return None
|
|
||||||
|
|
||||||
ip = addrinfos[0][4][0]
|
|
||||||
except:
|
except:
|
||||||
print "Unable to lookup the IP address of the provided host"
|
print "Unable to lookup the IP address of the provided host"
|
||||||
|
return None
|
||||||
|
|
||||||
|
for ai in addrinfos:
|
||||||
|
ip = ai[4][0]
|
||||||
|
if ip == "127.0.0.1" or ip == "::1":
|
||||||
|
print "The hostname resolves to the localhost address (127.0.0.1/::1)"
|
||||||
|
print "Please change your /etc/hosts file so that the hostname."
|
||||||
|
print "resolves to the ip address of your network interface."
|
||||||
|
print ""
|
||||||
|
print "Please fix your /etc/hosts file and restart the setup program."
|
||||||
|
print ""
|
||||||
|
sys.exit("Aborting installation.")
|
||||||
|
|
||||||
|
if addrinfos:
|
||||||
|
ip = addrinfos[0][4][0]
|
||||||
|
|
||||||
return ip
|
return ip
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -108,7 +113,7 @@ def main():
|
|||||||
|
|
||||||
# Check bind packages are installed
|
# Check bind packages are installed
|
||||||
if not bindinstance.check_inst(options.unattended):
|
if not bindinstance.check_inst(options.unattended):
|
||||||
sys.exit("Aborting installation")
|
sys.exit("Aborting installation.")
|
||||||
|
|
||||||
# Initialize the ipalib api
|
# Initialize the ipalib api
|
||||||
cfg = dict(
|
cfg = dict(
|
||||||
|
Loading…
Reference in New Issue
Block a user