From e01a28b584b8721d12a0b65fe4fdac507327f7da Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 4 Oct 2013 10:23:16 +0200 Subject: ipa-client-install: Use direct RPC instead of api.Command To make sure the installation works with older servers, use XML-RPC directly, with a version set explicitly so the request is not rejected. RPC was chosen over ldapmodify, because going through the API allows the server to process the request properly, or even cleanly reject it if there are incompatible changes in future versions. https://fedorahosted.org/freeipa/ticket/3931 --- ipa-client/ipa-install/ipa-client-install | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'ipa-client/ipa-install') diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index fdfadee7..e23e6dc5 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -1467,9 +1467,13 @@ def update_ssh_keys(server, hostname, ssh_dir, create_sshfp): f.close() try: - result = api.Command['host_mod'](unicode(hostname), + # Use the RPC directly so older servers are supported + api.Backend.xmlclient.forward( + 'host_mod', + unicode(hostname), ipasshpubkey=[pk.openssh() for pk in pubkeys], - updatedns=False + updatedns=False, + version=u'2.26', # this version adds support for SSH public keys ) except errors.EmptyModlist: pass @@ -2373,7 +2377,13 @@ def install(options, env, fstore, statestore): 'Cannot connect to the server due to generic error: %s', str(e)) return CLIENT_INSTALL_ERROR - remote_env = api.Command['env'](server=True)['result'] + # Use the RPC directly so older servers are supported + result = api.Backend.xmlclient.forward( + 'env', + server=True, + version=u'2.0', + ) + remote_env = result['result'] if not remote_env['enable_ra']: disable_ra() -- cgit