From: Thang Pham Date: Thu, 7 Aug 2014 21:41:11 +0000 (-0400) Subject: Do not translate debug messages X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1dfacd50b0305cb9e304aed45a3115f30d20c372;p=openstack-build%2Fcinder-build.git Do not translate debug messages LOG.debug messages do not need to be translated. The rdb driver has a couple of debug messages that are translated. This patch removes those debug translations. Also, logging exception.ImageUnacceptable can contain non-ascii characters. This patch fixes this by using six.text_type to properly translate the exception. Change-Id: I4ed36173f42b7bf487463f148ae94bd061f6bebb --- diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 827675c12..6deae00cf 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -18,6 +18,7 @@ import io import json import math import os +import six import tempfile import urllib @@ -747,18 +748,18 @@ class RBDDriver(driver.VolumeDriver): try: fsid, pool, image, snapshot = self._parse_location(image_location) except exception.ImageUnacceptable as e: - LOG.debug('not cloneable: %s', e) + LOG.debug('not cloneable: %s', six.text_type(e)) return False if self._get_fsid() != fsid: - reason = _('%s is in a different ceph cluster') % image_location + reason = ('%s is in a different ceph cluster') % image_location LOG.debug(reason) return False if image_meta['disk_format'] != 'raw': - reason = _("rbd image clone requires image format to be " - "'raw' but image {0} is '{1}'").format( - image_location, image_meta['disk_format']) + reason = ("rbd image clone requires image format to be " + "'raw' but image {0} is '{1}'").format( + image_location, image_meta['disk_format']) LOG.debug(reason) return False