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/object/v1/account.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'openstackclient/object/v1/account.py') diff --git a/openstackclient/object/v1/account.py b/openstackclient/object/v1/account.py index aa94ff5c..543ce4f3 100644 --- a/openstackclient/object/v1/account.py +++ b/openstackclient/object/v1/account.py @@ -13,12 +13,9 @@ """Account v1 action implementations""" -import logging - -from cliff import command -from cliff import show import six +from openstackclient.common import command from openstackclient.common import parseractions from openstackclient.common import utils @@ -26,8 +23,6 @@ from openstackclient.common import utils class SetAccount(command.Command): """Set account properties""" - log = logging.getLogger(__name__ + '.SetAccount') - def get_parser(self, prog_name): parser = super(SetAccount, self).get_parser(prog_name) parser.add_argument( @@ -40,19 +35,15 @@ class SetAccount(command.Command): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): self.app.client_manager.object_store.account_set( properties=parsed_args.property, ) -class ShowAccount(show.ShowOne): +class ShowAccount(command.ShowOne): """Display account details""" - log = logging.getLogger(__name__ + '.ShowAccount') - - @utils.log_method(log) def take_action(self, parsed_args): data = self.app.client_manager.object_store.account_show() if 'properties' in data: @@ -63,8 +54,6 @@ class ShowAccount(show.ShowOne): class UnsetAccount(command.Command): """Unset account properties""" - log = logging.getLogger(__name__ + '.UnsetAccount') - def get_parser(self, prog_name): parser = super(UnsetAccount, self).get_parser(prog_name) parser.add_argument( @@ -78,7 +67,6 @@ class UnsetAccount(command.Command): ) return parser - @utils.log_method(log) def take_action(self, parsed_args): self.app.client_manager.object_store.account_unset( properties=parsed_args.property, -- cgit v1.2.1