diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-06-16 20:01:15 +0800 |
|---|---|---|
| committer | Steve Martinelli <s.martinelli@gmail.com> | 2016-06-20 15:16:51 +0000 |
| commit | 047cb6849354f4fdf8d365bd109a0ed56a77d200 (patch) | |
| tree | dc7372f6e90946e82606c2f1a1d974bd02879201 /openstackclient/compute/v2/server_image.py | |
| parent | ba825a4d5c04e2e6fd8a82ebbfb2f71a85e683aa (diff) | |
| download | python-openstackclient-047cb6849354f4fdf8d365bd109a0ed56a77d200.tar.gz | |
Standardize logger usage
Use file logger for all command specific logs.
This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
After this patch, all self.log and self.app.log
will be standardized to LOG().
NOTE: In shell.py, we got the log in class OpenStackShell,
which is also known as self.app.log in other classes.
This logger is used to record non-command-specific logs.
So we leave it as-is.
Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
Diffstat (limited to 'openstackclient/compute/v2/server_image.py')
| -rw-r--r-- | openstackclient/compute/v2/server_image.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openstackclient/compute/v2/server_image.py b/openstackclient/compute/v2/server_image.py index 85ee7f2d..6f5a7546 100644 --- a/openstackclient/compute/v2/server_image.py +++ b/openstackclient/compute/v2/server_image.py @@ -15,6 +15,7 @@ """Compute v2 Server action implementations""" +import logging import sys from oslo_utils import importutils @@ -26,6 +27,9 @@ from openstackclient.common import utils from openstackclient.i18n import _ +LOG = logging.getLogger(__name__) + + def _show_progress(progress): if progress: sys.stdout.write('\rProgress: %s' % progress) @@ -90,10 +94,8 @@ class CreateServerImage(command.ShowOne): ): sys.stdout.write('\n') else: - self.log.error( - _('Error creating server image: %s') % - parsed_args.server, - ) + LOG.error(_('Error creating server image: %s'), + parsed_args.server) raise exceptions.CommandError if self.app.client_manager._api_version['image'] == '1': |
