From 258c1102cc6b93a860bcd7cc083d4e14ae0025ce Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sun, 10 Jan 2016 21:54:53 +0900 Subject: log take_action parameters in a single place Previously each command logs take_action parameters explicitly by using @utils.log_method decorator or log.debug(). Some commands have no logging. This commit calls a logger in the base class and drops all logging definition from individual commands. Closes-Bug: #1532294 Change-Id: I43cd0290a4353c68c075bade9571c940733da1be --- openstackclient/identity/v2_0/token.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'openstackclient/identity/v2_0/token.py') diff --git a/openstackclient/identity/v2_0/token.py b/openstackclient/identity/v2_0/token.py index 5fed58e5..db38fae8 100644 --- a/openstackclient/identity/v2_0/token.py +++ b/openstackclient/identity/v2_0/token.py @@ -15,26 +15,19 @@ """Identity v2 Token action implementations""" -import logging import six -from cliff import command -from cliff import show - -from openstackclient.common import utils +from openstackclient.common import command from openstackclient.i18n import _ # noqa -class IssueToken(show.ShowOne): +class IssueToken(command.ShowOne): """Issue new token""" - log = logging.getLogger(__name__ + '.IssueToken') - def get_parser(self, prog_name): parser = super(IssueToken, self).get_parser(prog_name) return parser - @utils.log_method(log) def take_action(self, parsed_args): token = self.app.client_manager.auth_ref.service_catalog.get_token() @@ -45,8 +38,6 @@ class IssueToken(show.ShowOne): class RevokeToken(command.Command): """Revoke existing token""" - log = logging.getLogger(__name__ + '.RevokeToken') - def get_parser(self, prog_name): parser = super(RevokeToken, self).get_parser(prog_name) parser.add_argument( @@ -57,7 +48,6 @@ class RevokeToken(command.Command): return parser def take_action(self, parsed_args): - self.log.debug('take_action(%s)' % parsed_args) identity_client = self.app.client_manager.identity identity_client.tokens.delete(parsed_args.token) -- cgit v1.2.1