diff --git a/senlinclient/common/sdk.py b/senlinclient/common/sdk.py index 12e28124..e68db4c5 100644 --- a/senlinclient/common/sdk.py +++ b/senlinclient/common/sdk.py @@ -123,7 +123,7 @@ class Resource(base.Resource): return self -def create_connection(preferences, user_agent, **kwargs): +def create_connection(preferences=None, user_agent=None, **kwargs): try: conn = connection.Connection(profile=preferences, user_agent=user_agent, diff --git a/senlinclient/shell.py b/senlinclient/shell.py index 78d43fd9..e2fa630b 100644 --- a/senlinclient/shell.py +++ b/senlinclient/shell.py @@ -233,8 +233,9 @@ class SenlinShell(object): 'token': args.token, 'trust_id': args.trust_id, } - return senlin_client.Client('1', args.user_preferences, - USER_AGENT, **kwargs) + + return senlin_client.Client('1', args.user_preferences, USER_AGENT, + **kwargs) def main(self, argv): # Parse args once to find version diff --git a/senlinclient/v1/client.py b/senlinclient/v1/client.py index af606c3b..fa70ae1c 100644 --- a/senlinclient/v1/client.py +++ b/senlinclient/v1/client.py @@ -21,7 +21,7 @@ from senlinclient.common import sdk class Client(object): - def __init__(self, preferences, user_agent, **kwargs): + def __init__(self, preferences=None, user_agent=None, **kwargs): if 'session' in kwargs: session = kwargs['session'] else: