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/v2_0/ec2creds.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/v2_0/ec2creds.py')
| -rw-r--r-- | openstackclient/identity/v2_0/ec2creds.py | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/openstackclient/identity/v2_0/ec2creds.py b/openstackclient/identity/v2_0/ec2creds.py index a7730ce2..a16b3d9e 100644 --- a/openstackclient/identity/v2_0/ec2creds.py +++ b/openstackclient/identity/v2_0/ec2creds.py @@ -16,22 +16,16 @@ """Identity v2 EC2 Credentials 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 from openstackclient.i18n import _ # noqa -class CreateEC2Creds(show.ShowOne): +class CreateEC2Creds(command.ShowOne): """Create EC2 credentials""" - log = logging.getLogger(__name__ + ".CreateEC2Creds") - def get_parser(self, prog_name): parser = super(CreateEC2Creds, self).get_parser(prog_name) parser.add_argument( @@ -52,7 +46,6 @@ class CreateEC2Creds(show.ShowOne): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity @@ -89,8 +82,6 @@ class CreateEC2Creds(show.ShowOne): class DeleteEC2Creds(command.Command): """Delete EC2 credentials""" - log = logging.getLogger(__name__ + '.DeleteEC2Creds') - def get_parser(self, prog_name): parser = super(DeleteEC2Creds, self).get_parser(prog_name) parser.add_argument( @@ -105,7 +96,6 @@ class DeleteEC2Creds(command.Command): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity @@ -121,11 +111,9 @@ class DeleteEC2Creds(command.Command): identity_client.ec2.delete(user, parsed_args.access_key) -class ListEC2Creds(lister.Lister): +class ListEC2Creds(command.Lister): """List EC2 credentials""" - log = logging.getLogger(__name__ + '.ListEC2Creds') - def get_parser(self, prog_name): parser = super(ListEC2Creds, self).get_parser(prog_name) parser.add_argument( @@ -135,7 +123,6 @@ class ListEC2Creds(lister.Lister): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity @@ -159,11 +146,9 @@ class ListEC2Creds(lister.Lister): ) for s in data)) -class ShowEC2Creds(show.ShowOne): +class ShowEC2Creds(command.ShowOne): """Display EC2 credentials details""" - log = logging.getLogger(__name__ + '.ShowEC2Creds') - def get_parser(self, prog_name): parser = super(ShowEC2Creds, self).get_parser(prog_name) parser.add_argument( @@ -178,7 +163,6 @@ class ShowEC2Creds(show.ShowOne): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity |
