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/federation_protocol.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/federation_protocol.py')
| -rw-r--r-- | openstackclient/identity/v3/federation_protocol.py | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/openstackclient/identity/v3/federation_protocol.py b/openstackclient/identity/v3/federation_protocol.py index 20877fcd..2d7ab15d 100644 --- a/openstackclient/identity/v3/federation_protocol.py +++ b/openstackclient/identity/v3/federation_protocol.py @@ -14,21 +14,15 @@ """Identity v3 Protocols actions 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 CreateProtocol(show.ShowOne): +class CreateProtocol(command.ShowOne): """Create new federation protocol""" - log = logging.getLogger(__name__ + 'CreateProtocol') - def get_parser(self, prog_name): parser = super(CreateProtocol, self).get_parser(prog_name) parser.add_argument( @@ -50,7 +44,6 @@ class CreateProtocol(show.ShowOne): return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity protocol = identity_client.federation.protocols.create( @@ -71,8 +64,6 @@ class CreateProtocol(show.ShowOne): class DeleteProtocol(command.Command): """Delete federation protocol""" - log = logging.getLogger(__name__ + '.DeleteProtocol') - def get_parser(self, prog_name): parser = super(DeleteProtocol, self).get_parser(prog_name) parser.add_argument( @@ -88,7 +79,6 @@ class DeleteProtocol(command.Command): return parser - @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity identity_client.federation.protocols.delete( @@ -96,11 +86,9 @@ class DeleteProtocol(command.Command): return -class ListProtocols(lister.Lister): +class ListProtocols(command.Lister): """List federation protocols""" - log = logging.getLogger(__name__ + '.ListProtocols') - def get_parser(self, prog_name): parser = super(ListProtocols, self).get_parser(prog_name) parser.add_argument( @@ -126,8 +114,6 @@ class ListProtocols(lister.Lister): class SetProtocol(command.Command): """Set federation protocol properties""" - log = logging.getLogger(__name__ + '.SetProtocol') - def get_parser(self, prog_name): parser = super(SetProtocol, self).get_parser(prog_name) parser.add_argument( @@ -166,11 +152,9 @@ class SetProtocol(command.Command): return zip(*sorted(six.iteritems(info))) -class ShowProtocol(show.ShowOne): +class ShowProtocol(command.ShowOne): """Display federation protocol details""" - log = logging.getLogger(__name__ + '.ShowProtocol') - def get_parser(self, prog_name): parser = super(ShowProtocol, self).get_parser(prog_name) parser.add_argument( |
