From d339608bc1cb271ccabf4f5980c9cfbda3c4f1fb Mon Sep 17 00:00:00 2001 From: Nikolay Mahotkin Date: Mon, 20 Apr 2015 13:13:41 +0300 Subject: [PATCH] Delete requirement on unneeded arguments * There was a requirement - mistralclient doesn't init without user_id or username and project_id or project_name However, keystone doesn't need this parameter if token is provided. Closes-Bug: #1407992 Change-Id: I903d52f2552d6b5e718d13d5957404e0a2d9f9d3 --- mistralclient/api/v2/client.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/mistralclient/api/v2/client.py b/mistralclient/api/v2/client.py index 69fb50dd..1f8a29b8 100644 --- a/mistralclient/api/v2/client.py +++ b/mistralclient/api/v2/client.py @@ -29,7 +29,7 @@ from mistralclient.api.v2 import workflows class Client(object): def __init__(self, mistral_url=None, username=None, api_key=None, project_name=None, auth_url=None, project_id=None, - endpoint_type='publicURL', service_type='workflow', + endpoint_type='publicURL', service_type='workflowv2', auth_token=None, user_id=None, cacert=None): if mistral_url and not isinstance(mistral_url, six.string_types): @@ -61,23 +61,13 @@ class Client(object): def authenticate(self, mistral_url=None, username=None, api_key=None, project_name=None, auth_url=None, project_id=None, - endpoint_type='publicURL', service_type='workflow', + endpoint_type='publicURL', service_type='workflowv2', auth_token=None, user_id=None, cacert=None): - if (not (project_name or project_id) or - not (isinstance(project_name, six.string_types) or - isinstance(project_id, six.string_types))): - raise RuntimeError('Either project name or project id should' - ' be non-empty string') if project_name and project_id: raise RuntimeError('Only project name or ' 'project id should be set') - if (not (username or user_id) or - not (isinstance(username, six.string_types) or - isinstance(user_id, six.string_types))): - raise RuntimeError('Either user name or user id should' - ' be non-empty string') if username and user_id: raise RuntimeError('Only user name or user id' ' should be set')