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
This commit is contained in:
Joshua Harlow
2015-09-01 16:43:07 -07:00
parent f14251669f
commit e3c46ece4a
50 changed files with 242 additions and 212 deletions

View File

@@ -47,8 +47,8 @@ class CreateKeypair(show.ShowOne):
)
return parser
@utils.log_method(log)
def take_action(self, parsed_args):
self.log.debug('take_action(%s)', parsed_args)
compute_client = self.app.client_manager.compute
public_key = parsed_args.public_key
@@ -93,8 +93,8 @@ class DeleteKeypair(command.Command):
)
return parser
@utils.log_method(log)
def take_action(self, parsed_args):
self.log.debug('take_action(%s)', parsed_args)
compute_client = self.app.client_manager.compute
compute_client.keypairs.delete(parsed_args.name)
return
@@ -140,8 +140,8 @@ class ShowKeypair(show.ShowOne):
)
return parser
@utils.log_method(log)
def take_action(self, parsed_args):
self.log.debug('take_action(%s)', parsed_args)
compute_client = self.app.client_manager.compute
keypair = utils.find_resource(compute_client.keypairs,
parsed_args.name)