summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/service.py
diff options
context:
space:
mode:
authorTerry Howe <terrylhowe@gmail.com>2014-03-12 11:51:17 -0600
committerTerry Howe <terrylhowe@gmail.com>2014-03-28 12:33:58 -0600
commitbea6e6ac23e893a85f4b0a49bab52934aca86726 (patch)
tree56b5da09e3a9c068b7b1e9bdf3cc08ef02e693f9 /openstackclient/identity/v3/service.py
parentcf8506d2bdbde02a731afb16a839e0660b71a89b (diff)
downloadpython-openstackclient-bea6e6ac23e893a85f4b0a49bab52934aca86726.tar.gz
Make endpoint commands more consistent
Make endpoints more consistent across create, show, etc * Make the name option required for create * Use a common function to fetch services by id, name or type * Have show work by endpoint id or by service id, type or name * Have show display all the fields by default * Remove capability to filter queries by attribute value pairs Change-Id: Idaa4b8d930ba859fd62de777e44a10b1ed58c79b Partial-Bug: #1184012
Diffstat (limited to 'openstackclient/identity/v3/service.py')
-rw-r--r--openstackclient/identity/v3/service.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/openstackclient/identity/v3/service.py b/openstackclient/identity/v3/service.py
index 7e3bfc6b..8576a6e6 100644
--- a/openstackclient/identity/v3/service.py
+++ b/openstackclient/identity/v3/service.py
@@ -23,6 +23,7 @@ from cliff import lister
from cliff import show
from openstackclient.common import utils
+from openstackclient.identity import common
class CreateService(show.ShowOne):
@@ -90,10 +91,7 @@ class DeleteService(command.Command):
self.log.debug('take_action(%s)' % parsed_args)
identity_client = self.app.client_manager.identity
- service = utils.find_resource(
- identity_client.services,
- parsed_args.service,
- )
+ service = common.find_service(identity_client, parsed_args.service)
identity_client.services.delete(service.id)
return
@@ -161,10 +159,7 @@ class SetService(command.Command):
and not parsed_args.disable):
return
- service = utils.find_resource(
- identity_client.services,
- parsed_args.service,
- )
+ service = common.find_service(identity_client, parsed_args.service)
kwargs = service._info
if parsed_args.type:
@@ -203,9 +198,6 @@ class ShowService(show.ShowOne):
self.log.debug('take_action(%s)' % parsed_args)
identity_client = self.app.client_manager.identity
- service = utils.find_resource(
- identity_client.services,
- parsed_args.service,
- )
+ service = common.find_service(identity_client, parsed_args.service)
return zip(*sorted(six.iteritems(service._info)))