summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/trust.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/identity/v3/trust.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/identity/v3/trust.py')
-rw-r--r--openstackclient/identity/v3/trust.py24
1 files changed, 4 insertions, 20 deletions
diff --git a/openstackclient/identity/v3/trust.py b/openstackclient/identity/v3/trust.py
index 2c3cf537..26fb8338 100644
--- a/openstackclient/identity/v3/trust.py
+++ b/openstackclient/identity/v3/trust.py
@@ -14,22 +14,16 @@
"""Identity v3 Trust action implementations"""
import datetime
-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
from openstackclient.identity import common
-class CreateTrust(show.ShowOne):
+class CreateTrust(command.ShowOne):
"""Create new trust"""
- log = logging.getLogger(__name__ + '.CreateTrust')
-
def get_parser(self, prog_name):
parser = super(CreateTrust, self).get_parser(prog_name)
parser.add_argument(
@@ -85,7 +79,6 @@ class CreateTrust(show.ShowOne):
return parser
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)' % parsed_args)
identity_client = self.app.client_manager.identity
# NOTE(stevemar): Find the two users, project and roles that
@@ -138,8 +131,6 @@ class CreateTrust(show.ShowOne):
class DeleteTrust(command.Command):
"""Delete trust(s)"""
- log = logging.getLogger(__name__ + '.DeleteTrust')
-
def get_parser(self, prog_name):
parser = super(DeleteTrust, self).get_parser(prog_name)
parser.add_argument(
@@ -151,20 +142,16 @@ class DeleteTrust(command.Command):
return parser
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)' % parsed_args)
identity_client = self.app.client_manager.identity
for t in parsed_args.trust:
trust_obj = utils.find_resource(identity_client.trusts, t)
identity_client.trusts.delete(trust_obj.id)
-class ListTrust(lister.Lister):
+class ListTrust(command.Lister):
"""List trusts"""
- log = logging.getLogger(__name__ + '.ListTrust')
-
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)' % parsed_args)
columns = ('ID', 'Expires At', 'Impersonation', 'Project ID',
'Trustee User ID', 'Trustor User ID')
data = self.app.client_manager.identity.trusts.list()
@@ -175,11 +162,9 @@ class ListTrust(lister.Lister):
) for s in data))
-class ShowTrust(show.ShowOne):
+class ShowTrust(command.ShowOne):
"""Display trust details"""
- log = logging.getLogger(__name__ + '.ShowTrust')
-
def get_parser(self, prog_name):
parser = super(ShowTrust, self).get_parser(prog_name)
parser.add_argument(
@@ -190,7 +175,6 @@ class ShowTrust(show.ShowOne):
return parser
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)' % parsed_args)
identity_client = self.app.client_manager.identity
trust = utils.find_resource(identity_client.trusts,
parsed_args.trust)