IPA Server check in ipa-replica-manage

When executing ipa-replica-manage connect to an master that raises
NotFound error we now check if the master is at least IPA server.
If so, we inform the user that it is probably foreign or previously
deleted master. If not, we inform the user that the master is not
an IPA server at all.

https://fedorahosted.org/freeipa/ticket/3105
This commit is contained in:
Tomas Babej
2012-10-02 09:15:33 -04:00
committed by Rob Crittenden
parent fe66fbe637
commit e7c99e7d21
2 changed files with 62 additions and 1 deletions

View File

@@ -810,6 +810,19 @@ def is_host_resolvable(fqdn):
return False
def host_exists(host):
"""
Resolve the host to see if it exists.
Returns True/False
"""
try:
socket.getaddrinfo(host, 80)
except socket.gaierror:
return False
else:
return True
def get_ipa_basedn(conn):
"""
Get base DN of IPA suffix in given LDAP server.