diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-06-20 17:26:57 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-06-20 17:26:57 +0000 |
| commit | f5ae23ab86c662e2f75952e6aa62c02ab3855b9b (patch) | |
| tree | 5bee5786f26c329c7dee8847cebc9d11ece1a04f /openstackclient/common/extension.py | |
| parent | a99b54ef758477376a6254face4ff7fcc698dd8f (diff) | |
| parent | 047cb6849354f4fdf8d365bd109a0ed56a77d200 (diff) | |
| download | python-openstackclient-f5ae23ab86c662e2f75952e6aa62c02ab3855b9b.tar.gz | |
Merge "Standardize logger usage"
Diffstat (limited to 'openstackclient/common/extension.py')
| -rw-r--r-- | openstackclient/common/extension.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/openstackclient/common/extension.py b/openstackclient/common/extension.py index 327fc223..de480016 100644 --- a/openstackclient/common/extension.py +++ b/openstackclient/common/extension.py @@ -16,6 +16,7 @@ """Extension action implementations""" import itertools +import logging from osc_lib.command import command from osc_lib import utils @@ -23,6 +24,9 @@ from osc_lib import utils from openstackclient.i18n import _ +LOG = logging.getLogger(__name__) + + class ListExtension(command.Lister): """List API extensions""" @@ -80,24 +84,25 @@ class ListExtension(command.Lister): try: data += identity_client.extensions.list() except Exception: - message = "Extensions list not supported by Identity API" - self.log.warning(message) + message = _("Extensions list not supported by Identity API") + LOG.warning(message) if parsed_args.compute or show_all: compute_client = self.app.client_manager.compute try: data += compute_client.list_extensions.show_all() except Exception: - message = "Extensions list not supported by Compute API" - self.log.warning(message) + message = _("Extensions list not supported by Compute API") + LOG.warning(message) if parsed_args.volume or show_all: volume_client = self.app.client_manager.volume try: data += volume_client.list_extensions.show_all() except Exception: - message = "Extensions list not supported by Block Storage API" - self.log.warning(message) + message = _("Extensions list not supported by " + "Block Storage API") + LOG.warning(message) # Resource classes for the above extension_tuples = ( @@ -125,7 +130,7 @@ class ListExtension(command.Lister): dict_tuples ) except Exception: - message = "Extensions list not supported by Network API" - self.log.warning(message) + message = _("Extensions list not supported by Network API") + LOG.warning(message) return (columns, extension_tuples) |
