diff options
author | Petr Viktorin <pviktori@redhat.com> | 2013-10-04 10:23:16 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2013-10-04 15:33:58 +0200 |
commit | e01a28b584b8721d12a0b65fe4fdac507327f7da (patch) | |
tree | 1d1dd2eb4a6cfa99f8324b899a33fbec1abb7f52 /ipa-client | |
parent | 321e8635ae74b9e494047ac22d384dfd92a9a28e (diff) | |
download | freeipa-e01a28b584b8721d12a0b65fe4fdac507327f7da.tar.gz freeipa-e01a28b584b8721d12a0b65fe4fdac507327f7da.tar.xz freeipa-e01a28b584b8721d12a0b65fe4fdac507327f7da.zip |
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
Diffstat (limited to 'ipa-client')
-rwxr-xr-x | ipa-client/ipa-install/ipa-client-install | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index fdfadee76..e23e6dc58 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() |