mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user