diff --git a/openstackclient/identity/v3/consumer.py b/openstackclient/identity/v3/consumer.py index 729839882a..0da4103d54 100644 --- a/openstackclient/identity/v3/consumer.py +++ b/openstackclient/identity/v3/consumer.py @@ -60,7 +60,6 @@ class DeleteConsumer(command.Command): consumer = utils.find_resource( identity_client.oauth1.consumers, parsed_args.consumer) identity_client.oauth1.consumers.delete(consumer.id) - return class ListConsumer(command.Lister): @@ -107,7 +106,6 @@ class SetConsumer(command.Command): consumer = identity_client.oauth1.consumers.update( consumer.id, **kwargs) - return class ShowConsumer(command.ShowOne): diff --git a/openstackclient/identity/v3/credential.py b/openstackclient/identity/v3/credential.py index 6208b32004..b0d2cafd0b 100644 --- a/openstackclient/identity/v3/credential.py +++ b/openstackclient/identity/v3/credential.py @@ -84,7 +84,6 @@ class DeleteCredential(command.Command): def take_action(self, parsed_args): identity_client = self.app.client_manager.identity identity_client.credentials.delete(parsed_args.credential) - return class ListCredential(command.Lister): @@ -155,8 +154,6 @@ class SetCredential(command.Command): blob=parsed_args.data, project=project) - return - class ShowCredential(command.ShowOne): """Show credential command""" diff --git a/openstackclient/identity/v3/domain.py b/openstackclient/identity/v3/domain.py index cec967b897..bf248fab9a 100644 --- a/openstackclient/identity/v3/domain.py +++ b/openstackclient/identity/v3/domain.py @@ -100,7 +100,6 @@ class DeleteDomain(command.Command): domain = utils.find_resource(identity_client.domains, parsed_args.domain) identity_client.domains.delete(domain.id) - return class ListDomain(command.Lister): @@ -168,7 +167,6 @@ class SetDomain(command.Command): sys.stdout.write("Domain not updated, no arguments present") return identity_client.domains.update(domain.id, **kwargs) - return class ShowDomain(command.ShowOne): diff --git a/openstackclient/identity/v3/endpoint.py b/openstackclient/identity/v3/endpoint.py index 1eff3b3b14..6e4b356d0b 100644 --- a/openstackclient/identity/v3/endpoint.py +++ b/openstackclient/identity/v3/endpoint.py @@ -109,7 +109,6 @@ class DeleteEndpoint(command.Command): endpoint_id = utils.find_resource(identity_client.endpoints, parsed_args.endpoint).id identity_client.endpoints.delete(endpoint_id) - return class ListEndpoint(command.Lister): @@ -221,7 +220,6 @@ class SetEndpoint(command.Command): if parsed_args.service: service = common.find_service(identity_client, parsed_args.service) service_id = service.id - enabled = None if parsed_args.enabled: enabled = True @@ -237,8 +235,6 @@ class SetEndpoint(command.Command): enabled=enabled ) - return - class ShowEndpoint(command.ShowOne): """Display endpoint details""" diff --git a/openstackclient/identity/v3/federation_protocol.py b/openstackclient/identity/v3/federation_protocol.py index 2d7ab15dfa..27c837c57b 100644 --- a/openstackclient/identity/v3/federation_protocol.py +++ b/openstackclient/identity/v3/federation_protocol.py @@ -83,7 +83,6 @@ class DeleteProtocol(command.Command): identity_client = self.app.client_manager.identity identity_client.federation.protocols.delete( parsed_args.identity_provider, parsed_args.federation_protocol) - return class ListProtocols(command.Lister): diff --git a/openstackclient/identity/v3/group.py b/openstackclient/identity/v3/group.py index b3d893ced6..a4cdd583e8 100644 --- a/openstackclient/identity/v3/group.py +++ b/openstackclient/identity/v3/group.py @@ -182,7 +182,6 @@ class DeleteGroup(command.Command): group, parsed_args.domain) identity_client.groups.delete(group_obj.id) - return class ListGroup(command.Lister): @@ -322,7 +321,6 @@ class SetGroup(command.Command): sys.stderr.write("Group not updated, no arguments present") return identity_client.groups.update(group.id, **kwargs) - return class ShowGroup(command.ShowOne): diff --git a/openstackclient/identity/v3/identity_provider.py b/openstackclient/identity/v3/identity_provider.py index 0ff8acb9a1..37f79ed6d0 100644 --- a/openstackclient/identity/v3/identity_provider.py +++ b/openstackclient/identity/v3/identity_provider.py @@ -102,7 +102,6 @@ class DeleteIdentityProvider(command.Command): identity_client = self.app.client_manager.identity identity_client.federation.identity_providers.delete( parsed_args.identity_provider) - return class ListIdentityProvider(command.Lister): diff --git a/openstackclient/identity/v3/mapping.py b/openstackclient/identity/v3/mapping.py index 422d66bcbd..3cdc8afc99 100644 --- a/openstackclient/identity/v3/mapping.py +++ b/openstackclient/identity/v3/mapping.py @@ -121,7 +121,6 @@ class DeleteMapping(command.Command): identity_client = self.app.client_manager.identity identity_client.federation.mappings.delete(parsed_args.mapping) - return class ListMapping(command.Lister): diff --git a/openstackclient/identity/v3/policy.py b/openstackclient/identity/v3/policy.py index 503df37404..3c2d1a7c94 100644 --- a/openstackclient/identity/v3/policy.py +++ b/openstackclient/identity/v3/policy.py @@ -69,7 +69,6 @@ class DeletePolicy(command.Command): def take_action(self, parsed_args): identity_client = self.app.client_manager.identity identity_client.policies.delete(parsed_args.policy) - return class ListPolicy(command.Lister): @@ -139,7 +138,6 @@ class SetPolicy(command.Command): sys.stdout.write('Policy not updated, no arguments present \n') return identity_client.policies.update(parsed_args.policy, **kwargs) - return class ShowPolicy(command.ShowOne): diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py index 61db861441..a379c6fa34 100644 --- a/openstackclient/identity/v3/project.py +++ b/openstackclient/identity/v3/project.py @@ -153,7 +153,6 @@ class DeleteProject(command.Command): project_obj = utils.find_resource(identity_client.projects, project) identity_client.projects.delete(project_obj.id) - return class ListProject(command.Lister): @@ -267,8 +266,8 @@ class SetProject(command.Command): and not parsed_args.property and not parsed_args.disable): return - - project = common.find_project(identity_client, parsed_args.project, + project = common.find_project(identity_client, + parsed_args.project, parsed_args.domain) kwargs = {} @@ -284,7 +283,6 @@ class SetProject(command.Command): kwargs.update(parsed_args.property) identity_client.projects.update(project.id, **kwargs) - return class ShowProject(command.ShowOne): diff --git a/openstackclient/identity/v3/region.py b/openstackclient/identity/v3/region.py index 1e15fd203c..ec5042286b 100644 --- a/openstackclient/identity/v3/region.py +++ b/openstackclient/identity/v3/region.py @@ -75,7 +75,6 @@ class DeleteRegion(command.Command): identity_client = self.app.client_manager.identity identity_client.regions.delete(parsed_args.region) - return class ListRegion(command.Lister): @@ -135,7 +134,6 @@ class SetRegion(command.Command): if not parsed_args.parent_region and not parsed_args.description: return - kwargs = {} if parsed_args.description: kwargs['description'] = parsed_args.description @@ -143,7 +141,6 @@ class SetRegion(command.Command): kwargs['parent_region'] = parsed_args.parent_region identity_client.regions.update(parsed_args.region, **kwargs) - return class ShowRegion(command.ShowOne): diff --git a/openstackclient/identity/v3/role.py b/openstackclient/identity/v3/role.py index 4cced61170..1195ab21a5 100644 --- a/openstackclient/identity/v3/role.py +++ b/openstackclient/identity/v3/role.py @@ -123,7 +123,6 @@ class AddRole(command.Command): if (not parsed_args.user and not parsed_args.domain and not parsed_args.group and not parsed_args.project): return - role = utils.find_resource( identity_client.roles, parsed_args.role, @@ -138,7 +137,6 @@ class AddRole(command.Command): return identity_client.roles.grant(role.id, **kwargs) - return class CreateRole(command.ShowOne): @@ -197,7 +195,6 @@ class DeleteRole(command.Command): role, ) identity_client.roles.delete(role_obj.id) - return class ListRole(command.Lister): @@ -318,8 +315,10 @@ class RemoveRole(command.Command): if (not parsed_args.user and not parsed_args.domain and not parsed_args.group and not parsed_args.project): + sys.stderr.write("Incorrect set of arguments " + "provided. See openstack --help for more " + "details\n") return - role = utils.find_resource( identity_client.roles, parsed_args.role, @@ -331,9 +330,7 @@ class RemoveRole(command.Command): sys.stderr.write("Role not removed, incorrect set of arguments \ provided. See openstack --help for more details\n") return - identity_client.roles.revoke(role.id, **kwargs) - return class SetRole(command.Command): @@ -357,15 +354,16 @@ class SetRole(command.Command): identity_client = self.app.client_manager.identity if not parsed_args.name: + sys.stderr.write("Incorrect set of arguments " + "provided. See openstack --help for more " + "details\n") return - role = utils.find_resource( identity_client.roles, parsed_args.role, ) identity_client.roles.update(role.id, name=parsed_args.name) - return class ShowRole(command.ShowOne): diff --git a/openstackclient/identity/v3/service.py b/openstackclient/identity/v3/service.py index 42117c8de9..355583cc30 100644 --- a/openstackclient/identity/v3/service.py +++ b/openstackclient/identity/v3/service.py @@ -16,6 +16,7 @@ """Identity v3 Service action implementations""" import six +import sys from openstackclient.common import command from openstackclient.common import utils @@ -91,7 +92,6 @@ class DeleteService(command.Command): service = common.find_service(identity_client, parsed_args.service) identity_client.services.delete(service.id) - return class ListService(command.Lister): @@ -166,10 +166,12 @@ class SetService(command.Command): and not parsed_args.description and not parsed_args.enable and not parsed_args.disable): + sys.stderr.write("Incorrect set of arguments " + "provided. See openstack --help for more " + "details\n") return - - service = common.find_service(identity_client, parsed_args.service) - + service = common.find_service(identity_client, + parsed_args.service) kwargs = {} if parsed_args.type: kwargs['type'] = parsed_args.type @@ -186,7 +188,6 @@ class SetService(command.Command): service.id, **kwargs ) - return class ShowService(command.ShowOne): diff --git a/openstackclient/identity/v3/service_provider.py b/openstackclient/identity/v3/service_provider.py index 6016928c11..e3a22ebb1a 100644 --- a/openstackclient/identity/v3/service_provider.py +++ b/openstackclient/identity/v3/service_provider.py @@ -96,7 +96,6 @@ class DeleteServiceProvider(command.Command): service_client = self.app.client_manager.identity service_client.federation.service_providers.delete( parsed_args.service_provider) - return class ListServiceProvider(command.Lister): diff --git a/openstackclient/identity/v3/token.py b/openstackclient/identity/v3/token.py index 5f131939cd..bf039d2fe6 100644 --- a/openstackclient/identity/v3/token.py +++ b/openstackclient/identity/v3/token.py @@ -194,4 +194,3 @@ class RevokeToken(command.Command): identity_client = self.app.client_manager.identity identity_client.tokens.revoke_token(parsed_args.token) - return diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py index c694c6aeb6..93b3309077 100644 --- a/openstackclient/identity/v3/user.py +++ b/openstackclient/identity/v3/user.py @@ -17,6 +17,7 @@ import copy import six +import sys from keystoneauth1 import exceptions as ks_exc @@ -162,7 +163,6 @@ class DeleteUser(command.Command): user_obj = utils.find_resource(identity_client.users, user) identity_client.users.delete(user_obj.id) - return class ListUser(command.Lister): @@ -334,13 +334,15 @@ class SetUser(command.Command): and not parsed_args.description and not parsed_args.enable and not parsed_args.disable): + sys.stderr.write("Incorrect set of arguments " + "provided. See openstack --help for more " + "details\n") return user = utils.find_resource( identity_client.users, parsed_args.user, ) - kwargs = {} if parsed_args.name: kwargs['name'] = parsed_args.name @@ -362,7 +364,6 @@ class SetUser(command.Command): kwargs['enabled'] = False identity_client.users.update(user.id, **kwargs) - return class SetPasswordUser(command.Command):