From 30d7d7d79e41fae268e49e4e9aa1bdd78cee6ef6 Mon Sep 17 00:00:00 2001 From: Andrey Pavlov Date: Fri, 23 Oct 2015 18:04:28 +0300 Subject: Fixing updates for CLI Fixing updates for some CLI methods, adding additional unit tests and small fixes Partially implements: blueprint cli-as-openstackclient-plugin Change-Id: I9e800ca4893fe4311517ca47f95d84620a73cee4 --- saharaclient/osc/v1/clusters.py | 1 + saharaclient/osc/v1/job_templates.py | 1 + saharaclient/osc/v1/node_group_templates.py | 18 +++++++++--------- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'saharaclient/osc/v1') diff --git a/saharaclient/osc/v1/clusters.py b/saharaclient/osc/v1/clusters.py index c08a2b6..9988043 100644 --- a/saharaclient/osc/v1/clusters.py +++ b/saharaclient/osc/v1/clusters.py @@ -399,6 +399,7 @@ class UpdateCluster(show.ShowOne): help='Make the cluster unprotected', dest='is_protected' ) + parser.set_defaults(is_public=None, is_protected=None) return parser diff --git a/saharaclient/osc/v1/job_templates.py b/saharaclient/osc/v1/job_templates.py index 359bbb5..2018dc4 100644 --- a/saharaclient/osc/v1/job_templates.py +++ b/saharaclient/osc/v1/job_templates.py @@ -299,6 +299,7 @@ class UpdateJobTemplate(show.ShowOne): help='Make the job template unprotected', dest='is_protected' ) + parser.set_defaults(is_public=None, is_protected=None) return parser diff --git a/saharaclient/osc/v1/node_group_templates.py b/saharaclient/osc/v1/node_group_templates.py index 0fceac8..d610e5a 100644 --- a/saharaclient/osc/v1/node_group_templates.py +++ b/saharaclient/osc/v1/node_group_templates.py @@ -75,6 +75,11 @@ class CreateNodeGroupTemplate(show.ShowOne): help="List of the processes that will be launched on each " "instance [REQUIRED if JSON is not provided]" ) + parser.add_argument( + '--flavor', + metavar="", + help="ID of the flavor [REQUIRED if JSON is not provided]" + ) parser.add_argument( '--security-groups', metavar="", @@ -95,11 +100,6 @@ class CreateNodeGroupTemplate(show.ShowOne): help="Name of the availability zone where instances " "will be created" ) - parser.add_argument( - '--flavor', - metavar="", - help="ID of the flavor" - ) parser.add_argument( '--floating-ip-pool', metavar="", @@ -214,12 +214,12 @@ class CreateNodeGroupTemplate(show.ShowOne): data = client.node_group_templates.create(**template).to_dict() else: if (not parsed_args.name or not parsed_args.plugin or - not parsed_args.version or not parsed_args or + not parsed_args.version or not parsed_args.flavor or not parsed_args.processes): raise exceptions.CommandError( - 'At least --name, --plugin, --version, --processes ' - 'arguments should be specified or json template should ' - 'be provided with --json argument') + 'At least --name, --plugin, --version, --processes, ' + '--flavor arguments should be specified or json template ' + 'should be provided with --json argument') configs = None if parsed_args.configs: -- cgit v1.2.1