summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/token.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/token.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/token.py')
-rw-r--r--openstackclient/identity/v3/token.py25
1 files changed, 5 insertions, 20 deletions
diff --git a/openstackclient/identity/v3/token.py b/openstackclient/identity/v3/token.py
index cd3dc798..588c5218 100644
--- a/openstackclient/identity/v3/token.py
+++ b/openstackclient/identity/v3/token.py
@@ -15,20 +15,16 @@
"""Identity v3 Token action implementations"""
-import logging
import six
-from cliff import show
-
+from openstackclient.common import command
from openstackclient.common import utils
from openstackclient.identity import common
-class AuthorizeRequestToken(show.ShowOne):
+class AuthorizeRequestToken(command.ShowOne):
"""Authorize a request token"""
- log = logging.getLogger(__name__ + '.AuthorizeRequestToken')
-
def get_parser(self, prog_name):
parser = super(AuthorizeRequestToken, self).get_parser(prog_name)
parser.add_argument(
@@ -49,7 +45,6 @@ class AuthorizeRequestToken(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): We want a list of role ids
@@ -68,11 +63,9 @@ class AuthorizeRequestToken(show.ShowOne):
return zip(*sorted(six.iteritems(verifier_pin._info)))
-class CreateAccessToken(show.ShowOne):
+class CreateAccessToken(command.ShowOne):
"""Create an access token"""
- log = logging.getLogger(__name__ + '.CreateAccessToken')
-
def get_parser(self, prog_name):
parser = super(CreateAccessToken, self).get_parser(prog_name)
parser.add_argument(
@@ -108,7 +101,6 @@ class CreateAccessToken(show.ShowOne):
return parser
def take_action(self, parsed_args):
- self.log.debug('take_action(%s)' % parsed_args)
token_client = self.app.client_manager.identity.oauth1.access_tokens
access_token = token_client.create(
parsed_args.consumer_key, parsed_args.consumer_secret,
@@ -117,11 +109,9 @@ class CreateAccessToken(show.ShowOne):
return zip(*sorted(six.iteritems(access_token._info)))
-class CreateRequestToken(show.ShowOne):
+class CreateRequestToken(command.ShowOne):
"""Create a request token"""
- log = logging.getLogger(__name__ + '.CreateRequestToken')
-
def get_parser(self, prog_name):
parser = super(CreateRequestToken, self).get_parser(prog_name)
parser.add_argument(
@@ -151,8 +141,6 @@ class CreateRequestToken(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
if parsed_args.domain:
@@ -173,16 +161,13 @@ class CreateRequestToken(show.ShowOne):
return zip(*sorted(six.iteritems(request_token._info)))
-class IssueToken(show.ShowOne):
+class IssueToken(command.ShowOne):
"""Issue new token"""
- log = logging.getLogger(__name__ + '.IssueToken')
-
def get_parser(self, prog_name):
parser = super(IssueToken, self).get_parser(prog_name)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
token = self.app.client_manager.auth_ref.service_catalog.get_token()
if 'tenant_id' in token: