diff options
author | Petr Viktorin <pviktori@redhat.com> | 2013-10-04 00:44:51 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2013-10-04 15:33:50 +0200 |
commit | 96ab7002ac2acfc129dd73f1fc9b023a6fbf3723 (patch) | |
tree | 573a4ea2d98b1e02d49f8b61ec2a73ccf3414c3b /ipa-client | |
parent | 960c67aca8be1981e5748c3f1f6ab031f115846e (diff) | |
download | freeipa-96ab7002ac2acfc129dd73f1fc9b023a6fbf3723.tar.gz freeipa-96ab7002ac2acfc129dd73f1fc9b023a6fbf3723.tar.xz freeipa-96ab7002ac2acfc129dd73f1fc9b023a6fbf3723.zip |
ipa-client-install: Verify RPC connection with a ping
With old servers, it is possible that xmlclient.connect() succeeds
but commands fail with a Kerberos error.
Verify that commands succeed by sending a ping after connecting.
Follow-up to: https://fedorahosted.org/freeipa/ticket/3931
Diffstat (limited to 'ipa-client')
-rwxr-xr-x | ipa-client/ipa-install/ipa-client-install | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index 11eedfad2..01831663c 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -2324,13 +2324,22 @@ def install(options, env, fstore, statestore): pass # Now, let's try to connect to the server's XML-RPC interface + connected = False try: api.Backend.xmlclient.connect() + connected = True + root_logger.debug('Try RPC connection') + api.Backend.xmlclient.forward('ping') except errors.KerberosError, e: + if connected: + api.Backend.xmlclient.disconnect() root_logger.info('Cannot connect to the server due to ' + 'Kerberos error: %s. Trying with delegate=True', str(e)) try: api.Backend.xmlclient.connect(delegate=True) + root_logger.debug('Try RPC connection') + api.Backend.xmlclient.forward('ping') + root_logger.info('Connection with delegate=True successful') # The remote server is not capable of Kerberos S4U2Proxy delegation |