diff options
| author | Akihiro Motoki <motoki@da.jp.nec.com> | 2016-01-10 21:54:53 +0900 |
|---|---|---|
| committer | Akihiro Motoki <motoki@da.jp.nec.com> | 2016-02-02 09:58:32 +0900 |
| commit | 258c1102cc6b93a860bcd7cc083d4e14ae0025ce (patch) | |
| tree | 6b963e16d6bd946c066a7163f6f36e7becba9b3b /openstackclient/identity/v3/credential.py | |
| parent | e9ff42eee73de147339c42bca90f777a8f40f5c1 (diff) | |
| download | python-openstackclient-258c1102cc6b93a860bcd7cc083d4e14ae0025ce.tar.gz | |
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
Diffstat (limited to 'openstackclient/identity/v3/credential.py')
| -rw-r--r-- | openstackclient/identity/v3/credential.py | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/openstackclient/identity/v3/credential.py b/openstackclient/identity/v3/credential.py index f22092d4..6208b320 100644 --- a/openstackclient/identity/v3/credential.py +++ b/openstackclient/identity/v3/credential.py @@ -15,21 +15,15 @@ """Identity v3 Credential action implementations""" -import logging import six -from cliff import command -from cliff import lister -from cliff import show - +from openstackclient.common import command from openstackclient.common import utils -class CreateCredential(show.ShowOne): +class CreateCredential(command.ShowOne): """Create credential command""" - log = logging.getLogger(__name__ + '.CreateCredential') - def get_parser(self, prog_name): parser = super(CreateCredential, self).get_parser(prog_name) parser.add_argument( @@ -56,7 +50,6 @@ class CreateCredential(show.ShowOne): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity user_id = utils.find_resource(identity_client.users, @@ -79,8 +72,6 @@ class CreateCredential(show.ShowOne): class DeleteCredential(command.Command): """Delete credential command""" - log = logging.getLogger(__name__ + '.DeleteCredential') - def get_parser(self, prog_name): parser = super(DeleteCredential, self).get_parser(prog_name) parser.add_argument( @@ -90,19 +81,15 @@ class DeleteCredential(command.Command): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity identity_client.credentials.delete(parsed_args.credential) return -class ListCredential(lister.Lister): +class ListCredential(command.Lister): """List credential command""" - log = logging.getLogger(__name__ + '.ListCredential') - - @utils.log_method(log) def take_action(self, parsed_args): columns = ('ID', 'Type', 'User ID', 'Blob', 'Project ID') column_headers = ('ID', 'Type', 'User ID', 'Data', 'Project ID') @@ -117,8 +104,6 @@ class ListCredential(lister.Lister): class SetCredential(command.Command): """Set credential command""" - log = logging.getLogger(__name__ + '.SetCredential') - def get_parser(self, prog_name): parser = super(SetCredential, self).get_parser(prog_name) parser.add_argument( @@ -152,7 +137,6 @@ class SetCredential(command.Command): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity @@ -174,11 +158,9 @@ class SetCredential(command.Command): return -class ShowCredential(show.ShowOne): +class ShowCredential(command.ShowOne): """Show credential command""" - log = logging.getLogger(__name__ + '.ShowCredential') - def get_parser(self, prog_name): parser = super(ShowCredential, self).get_parser(prog_name) parser.add_argument( @@ -188,7 +170,6 @@ class ShowCredential(show.ShowOne): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity credential = utils.find_resource(identity_client.credentials, |
