diff options
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/flavor.py | 6 | ||||
| -rw-r--r-- | openstackclient/compute/v2/host.py | 22 | ||||
| -rw-r--r-- | openstackclient/compute/v2/service.py | 4 |
3 files changed, 14 insertions, 18 deletions
diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py index f2acfc39..01d7da75 100644 --- a/openstackclient/compute/v2/flavor.py +++ b/openstackclient/compute/v2/flavor.py @@ -320,9 +320,6 @@ class SetFlavor(command.Command): flavor = _find_flavor(compute_client, parsed_args.flavor) - if not parsed_args.property and not parsed_args.project: - raise exceptions.CommandError(_("Nothing specified to be set.")) - result = 0 if parsed_args.property: try: @@ -409,9 +406,6 @@ class UnsetFlavor(command.Command): flavor = _find_flavor(compute_client, parsed_args.flavor) - if not parsed_args.property and not parsed_args.project: - raise exceptions.CommandError(_("Nothing specified to be unset.")) - result = 0 if parsed_args.property: try: diff --git a/openstackclient/compute/v2/host.py b/openstackclient/compute/v2/host.py index 764b22af..78567589 100644 --- a/openstackclient/compute/v2/host.py +++ b/openstackclient/compute/v2/host.py @@ -54,7 +54,7 @@ class SetHost(command.Command): parser.add_argument( "host", metavar="<host>", - help=_("The host to modify (name or ID)") + help=_("Host to modify (name only)") ) status = parser.add_mutually_exclusive_group() status.add_argument( @@ -84,22 +84,24 @@ class SetHost(command.Command): kwargs = {} if parsed_args.enable: - kwargs['status'] = True + kwargs['status'] = 'enable' if parsed_args.disable: - kwargs['status'] = False + kwargs['status'] = 'disable' if parsed_args.enable_maintenance: - kwargs['maintenance_mode'] = True + kwargs['maintenance_mode'] = 'enable' if parsed_args.disable_maintenance: - kwargs['maintenance_mode'] = False + kwargs['maintenance_mode'] = 'disable' compute_client = self.app.client_manager.compute - foundhost = utils.find_resource( - compute_client.hosts, - parsed_args.host - ) + + # More than one hosts will be returned by using find_resource() + # so that the return value cannot be used in host update() method. + # find_resource() is just used for checking existence of host and + # keeping the exception message consistent with other commands. + utils.find_resource(compute_client.hosts, parsed_args.host) compute_client.hosts.update( - foundhost.id, + parsed_args.host, kwargs ) diff --git a/openstackclient/compute/v2/service.py b/openstackclient/compute/v2/service.py index 36917e20..2e40dd7f 100644 --- a/openstackclient/compute/v2/service.py +++ b/openstackclient/compute/v2/service.py @@ -73,7 +73,7 @@ class ListService(command.Lister): compute_client = self.app.client_manager.compute if parsed_args.long: columns = ( - "Id", + "ID", "Binary", "Host", "Zone", @@ -84,7 +84,7 @@ class ListService(command.Lister): ) else: columns = ( - "Id", + "ID", "Binary", "Host", "Zone", |
