summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2/aggregate.py
diff options
context:
space:
mode:
authorAkihiro Motoki <motoki@da.jp.nec.com>2016-01-10 21:54:53 +0900
committerAkihiro Motoki <motoki@da.jp.nec.com>2016-02-02 09:58:32 +0900
commit258c1102cc6b93a860bcd7cc083d4e14ae0025ce (patch)
tree6b963e16d6bd946c066a7163f6f36e7becba9b3b /openstackclient/compute/v2/aggregate.py
parente9ff42eee73de147339c42bca90f777a8f40f5c1 (diff)
downloadpython-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/compute/v2/aggregate.py')
-rw-r--r--openstackclient/compute/v2/aggregate.py43
1 files changed, 7 insertions, 36 deletions
diff --git a/openstackclient/compute/v2/aggregate.py b/openstackclient/compute/v2/aggregate.py
index 97ad127c..5f297257 100644
--- a/openstackclient/compute/v2/aggregate.py
+++ b/openstackclient/compute/v2/aggregate.py
@@ -16,22 +16,16 @@
"""Compute v2 Aggregate 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 parseractions
from openstackclient.common import utils
-class AddAggregateHost(show.ShowOne):
+class AddAggregateHost(command.ShowOne):
"""Add host to aggregate"""
- log = logging.getLogger(__name__ + '.AddAggregateHost')
-
def get_parser(self, prog_name):
parser = super(AddAggregateHost, self).get_parser(prog_name)
parser.add_argument(
@@ -47,8 +41,6 @@ class AddAggregateHost(show.ShowOne):
return parser
def take_action(self, parsed_args):
- self.log.debug("take_action(%s)", parsed_args)
-
compute_client = self.app.client_manager.compute
aggregate = utils.find_resource(
@@ -62,11 +54,9 @@ class AddAggregateHost(show.ShowOne):
return zip(*sorted(six.iteritems(info)))
-class CreateAggregate(show.ShowOne):
+class CreateAggregate(command.ShowOne):
"""Create a new aggregate"""
- log = logging.getLogger(__name__ + ".CreateAggregate")
-
def get_parser(self, prog_name):
parser = super(CreateAggregate, self).get_parser(prog_name)
parser.add_argument(
@@ -89,8 +79,6 @@ class CreateAggregate(show.ShowOne):
return parser
def take_action(self, parsed_args):
- self.log.debug("take_action(%s)", parsed_args)
-
compute_client = self.app.client_manager.compute
info = {}
@@ -112,8 +100,6 @@ class CreateAggregate(show.ShowOne):
class DeleteAggregate(command.Command):
"""Delete an existing aggregate"""
- log = logging.getLogger(__name__ + '.DeleteAggregate')
-
def get_parser(self, prog_name):
parser = super(DeleteAggregate, self).get_parser(prog_name)
parser.add_argument(
@@ -123,7 +109,6 @@ class DeleteAggregate(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute
@@ -134,11 +119,9 @@ class DeleteAggregate(command.Command):
compute_client.aggregates.delete(data.id)
-class ListAggregate(lister.Lister):
+class ListAggregate(command.Lister):
"""List all aggregates"""
- log = logging.getLogger(__name__ + ".ListAggregate")
-
def get_parser(self, prog_name):
parser = super(ListAggregate, self).get_parser(prog_name)
parser.add_argument(
@@ -149,8 +132,6 @@ class ListAggregate(lister.Lister):
return parser
def take_action(self, parsed_args):
- self.log.debug("take_action(%s)", parsed_args)
-
compute_client = self.app.client_manager.compute
data = compute_client.aggregates.list()
@@ -186,11 +167,9 @@ class ListAggregate(lister.Lister):
) for s in data))
-class RemoveAggregateHost(show.ShowOne):
+class RemoveAggregateHost(command.ShowOne):
"""Remove host from aggregate"""
- log = logging.getLogger(__name__ + '.RemoveAggregateHost')
-
def get_parser(self, prog_name):
parser = super(RemoveAggregateHost, self).get_parser(prog_name)
parser.add_argument(
@@ -206,8 +185,6 @@ class RemoveAggregateHost(show.ShowOne):
return parser
def take_action(self, parsed_args):
- self.log.debug("take_action(%s)", parsed_args)
-
compute_client = self.app.client_manager.compute
aggregate = utils.find_resource(
@@ -224,11 +201,9 @@ class RemoveAggregateHost(show.ShowOne):
return zip(*sorted(six.iteritems(info)))
-class SetAggregate(show.ShowOne):
+class SetAggregate(command.ShowOne):
"""Set aggregate properties"""
- log = logging.getLogger(__name__ + '.SetAggregate')
-
def get_parser(self, prog_name):
parser = super(SetAggregate, self).get_parser(prog_name)
parser.add_argument(
@@ -255,7 +230,6 @@ class SetAggregate(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute
@@ -288,11 +262,9 @@ class SetAggregate(show.ShowOne):
return ({}, {})
-class ShowAggregate(show.ShowOne):
+class ShowAggregate(command.ShowOne):
"""Display aggregate details"""
- log = logging.getLogger(__name__ + '.ShowAggregate')
-
def get_parser(self, prog_name):
parser = super(ShowAggregate, self).get_parser(prog_name)
parser.add_argument(
@@ -302,7 +274,6 @@ class ShowAggregate(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute