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 <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-05-25 12:20:31 +02:00
parent f35beca68c
commit 43dc424041
2 changed files with 10 additions and 3 deletions

View File

@@ -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()