From a4dd1fc71402c8ccc10387c889f40c09e7396b8b Mon Sep 17 00:00:00 2001 From: liyifeng <307419146@qq.com> Date: Tue, 21 Jun 2016 10:12:08 +0800 Subject: [PATCH] Make the print info support i18n When OSC failed to set a image's property, it will print the image name and status, which is an useful info to users. So translate this massage, and record it in log. Change-Id: Icdff4dab17dedcb40289700c4cd278e6e62eea25 --- openstackclient/image/v2/image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 82566ff379..309b1b6b18 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -836,7 +836,8 @@ class SetImage(command.Command): image = image_client.images.update(image.id, **kwargs) except Exception as e: if activation_status is not None: - print("Image %s was %s." % (image.id, activation_status)) + LOG.info(_("Image %(id)s was %(status)s."), + {'id': image.id, 'status': activation_status}) raise e