From 43dc424041e6766dbadd46f6f3982d85e69049cc Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Wed, 25 May 2016 12:20:31 +0200 Subject: [PATCH] rpc: respect API config in RPCClient.create_connection When connecting rpcclient, get the default values of the `verbose`, `fallback` and `delegate` options from API config rather than hard-code them. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka --- client/ipa-client-install | 3 ++- ipalib/rpc.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/ipa-client-install b/client/ipa-client-install index 1606d1d2f..2c5b20769 100755 --- a/client/ipa-client-install +++ b/client/ipa-client-install @@ -2794,7 +2794,8 @@ def install(options, env, fstore, statestore): # Now, let's try to connect to the server's RPC interface connected = False try: - api.Backend.rpcclient.connect(nss_dir=tmp_db.secdir) + api.Backend.rpcclient.connect(delegate=False, + nss_dir=tmp_db.secdir) connected = True root_logger.debug("Try RPC connection") api.Backend.rpcclient.forward('ping') diff --git a/ipalib/rpc.py b/ipalib/rpc.py index 67b503b69..120b28501 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -861,8 +861,14 @@ class RPCClient(Connectible): return session_url - def create_connection(self, ccache=None, verbose=0, fallback=True, - delegate=False, nss_dir=None): + def create_connection(self, ccache=None, verbose=None, fallback=None, + delegate=None, nss_dir=None): + if verbose is None: + verbose = self.api.env.verbose + if fallback is None: + fallback = self.api.env.fallback + if delegate is None: + delegate = self.api.env.delegate try: rpc_uri = self.env[self.env_rpc_uri_key] principal = get_principal()