diff --git a/mistralclient/api/client.py b/mistralclient/api/client.py index e6195ebe..1012b06c 100644 --- a/mistralclient/api/client.py +++ b/mistralclient/api/client.py @@ -79,7 +79,8 @@ class Client(object): if "v2.0" in auth_url: raise RuntimeError('Mistral supports only v3 ' - 'keystone API.') + 'keystone API. Please see help and ' + 'configure the correct auth url.') keystone = keystone_client.Client(username=username, user_id=user_id, diff --git a/mistralclient/commands/workbooks.py b/mistralclient/commands/workbooks.py index 4e119506..435eec1a 100644 --- a/mistralclient/commands/workbooks.py +++ b/mistralclient/commands/workbooks.py @@ -88,8 +88,14 @@ class Create(ShowCommand): help='Workbook description') parser.add_argument( 'tags', - nargs='*', - help='Workbook tags') + nargs='?', + help='Workbook tags separated by ","') + parser.add_argument( + 'definition', + nargs='?', + type=argparse.FileType('r'), + help='Workbook definition file' + ) return parser @@ -97,7 +103,12 @@ class Create(ShowCommand): workbook = WorkbookManager(self.app.client)\ .create(parsed_args.name, parsed_args.description, - parsed_args.tags) + str(parsed_args.tags).split(',')) + + if parsed_args.definition: + WorkbookManager(self.app.client)\ + .upload_definition(parsed_args.name, + parsed_args.definition.read()) return format(workbook)