summaryrefslogtreecommitdiff
path: root/openstackclient/object
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-09-01 16:43:07 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-09-01 16:49:54 -0700
commite3c46ece4a496584a54b9d39b55921990db4a7b3 (patch)
treeaadf0d2f80f18d77ebc003be3168d36dcb01a275 /openstackclient/object
parentf14251669f96d6010581702417828f4380144aa2 (diff)
downloadpython-openstackclient-e3c46ece4a496584a54b9d39b55921990db4a7b3.tar.gz
Use a common decorator to log 'take_action' activation
Instead of duplicating the same log statement throughout the code, the same logic can be provided by a shared decorator that abstracts away the logging capability and unifies it behind a common function instead. Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
Diffstat (limited to 'openstackclient/object')
-rw-r--r--openstackclient/object/v1/container.py8
-rw-r--r--openstackclient/object/v1/object.py8
2 files changed, 8 insertions, 8 deletions
diff --git a/openstackclient/object/v1/container.py b/openstackclient/object/v1/container.py
index bc4fdec8..49173deb 100644
--- a/openstackclient/object/v1/container.py
+++ b/openstackclient/object/v1/container.py
@@ -41,8 +41,8 @@ class CreateContainer(lister.Lister):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
results = []
for container in parsed_args.containers:
@@ -74,8 +74,8 @@ class DeleteContainer(command.Command):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
for container in parsed_args.containers:
self.app.client_manager.object_store.container_delete(
@@ -125,8 +125,8 @@ class ListContainer(lister.Lister):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
if parsed_args.long:
columns = ('Name', 'Bytes', 'Count')
@@ -192,8 +192,8 @@ class ShowContainer(show.ShowOne):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
data = self.app.client_manager.object_store.container_show(
container=parsed_args.container,
diff --git a/openstackclient/object/v1/object.py b/openstackclient/object/v1/object.py
index 752d7842..c90f0319 100644
--- a/openstackclient/object/v1/object.py
+++ b/openstackclient/object/v1/object.py
@@ -46,8 +46,8 @@ class CreateObject(lister.Lister):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
results = []
for obj in parsed_args.objects:
@@ -85,8 +85,8 @@ class DeleteObject(command.Command):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
for obj in parsed_args.objects:
self.app.client_manager.object_store.object_delete(
@@ -147,8 +147,8 @@ class ListObject(lister.Lister):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
if parsed_args.long:
columns = (
@@ -240,8 +240,8 @@ class ShowObject(show.ShowOne):
)
return parser
+ @utils.log_method(log)
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)', parsed_args)
data = self.app.client_manager.object_store.object_show(
container=parsed_args.container,