summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/credential.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-09-01 16:43:07 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-09-01 16:49:54 -0700
commite3c46ece4a496584a54b9d39b55921990db4a7b3 (patch)
treeaadf0d2f80f18d77ebc003be3168d36dcb01a275 /openstackclient/identity/v3/credential.py
parentf14251669f96d6010581702417828f4380144aa2 (diff)
downloadpython-openstackclient-e3c46ece4a496584a54b9d39b55921990db4a7b3.tar.gz
Use a common decorator to log 'take_action' activation
Instead of duplicating the same log statement throughout the code, the same logic can be provided by a shared decorator that abstracts away the logging capability and unifies it behind a common function instead. Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
Diffstat (limited to 'openstackclient/identity/v3/credential.py')
-rw-r--r--openstackclient/identity/v3/credential.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/openstackclient/identity/v3/credential.py b/openstackclient/identity/v3/credential.py
index dacbc9af..dbd73e2e 100644
--- a/openstackclient/identity/v3/credential.py
+++ b/openstackclient/identity/v3/credential.py
@@ -57,8 +57,8 @@ class CreateCredential(show.ShowOne):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
identity_client = self.app.client_manager.identity
user_id = utils.find_resource(identity_client.users,
parsed_args.user).id
@@ -91,8 +91,8 @@ class DeleteCredential(command.Command):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
identity_client = self.app.client_manager.identity
identity_client.credentials.delete(parsed_args.credential)
return
@@ -103,8 +103,8 @@ class ListCredential(lister.Lister):
log = logging.getLogger(__name__ + '.ListCredential')
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
columns = ('ID', 'Type', 'User ID', 'Blob', 'Project ID')
column_headers = ('ID', 'Type', 'User ID', 'Data', 'Project ID')
data = self.app.client_manager.identity.credentials.list()
@@ -150,8 +150,8 @@ class SetCredential(command.Command):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
identity_client = self.app.client_manager.identity
kwargs = {}
if parsed_args.user:
@@ -189,8 +189,8 @@ class ShowCredential(show.ShowOne):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
identity_client = self.app.client_manager.identity
credential = utils.find_resource(identity_client.credentials,
parsed_args.credential)