Detection of v1 server during ipa-client-install

When v2 IPA client is trying to join an IPA v1 server
a strange exception is printed out to the user. This patch
detects this by catching an XML-RPC error reported by ipa-join
binary called in the process which fails on unexisting IPA server
'join' method.

https://fedorahosted.org/freeipa/ticket/553
This commit is contained in:
Martin Kosek 2011-02-03 17:20:26 +01:00 committed by Rob Crittenden
parent 04597f4e36
commit 309ed42865

View File

@ -684,7 +684,11 @@ def main():
(stdout, stderr, returncode) = run(join_args, raiseonerr=False, env=env)
if returncode != 0:
print >>sys.stderr, "Joining realm failed: %s" % stderr,
if returncode == 17: # XML-RPC fault - possible IPA v1/v2 incompatibility
print "Joining realm failed because of failing XML-RPC request."
print " This error may be caused by incompatible server/client major versions."
else:
print >>sys.stderr, "Joining realm failed: %s" % stderr,
if not options.force:
return 1
print " Use ipa-getkeytab to obtain a host principal for this server."