]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Remove str() from LOG.* and exceptions
authorJay S. Bryant <jsbryant@us.ibm.com>
Wed, 26 Feb 2014 20:40:38 +0000 (14:40 -0600)
committerJay S. Bryant <jsbryant@us.ibm.com>
Tue, 4 Mar 2014 20:25:10 +0000 (14:25 -0600)
commitcbe1d5f5e22e5f792128643e4cdd6afb2ff2b5bf
treec7ce4bff5cb5b5bc5202fca0e7e4087d7d06350e
parentee371dfc56e9a633ba56bd05f7a32a1e3744fef2
Remove str() from LOG.* and exceptions

This commit removes the use of str() from LOG.* messages
and exceptions.

The reason we need to remove str() is because str() will fail if
it gets a Unicode string that has something that doesn't translate
to ASCII in it.  If such a situation is encountered you will lose
the message string in question.  In most cases, the use of str() is
unnecessary for LOG.* and exception messages.  Using %s is smart
enough to figure out what to do with what it is passed.  It first
tries to str() it, if this fails it falls back to using unicode.  Either
way, the result will then be something that gettextutils can
handle and translate.

Change-Id: I6eb81043edd9fa5e035d81ee81e8439340546d24
Closes-bug: 1274245
Related-bp: i18n-messages
38 files changed:
cinder/api/contrib/qos_specs_manage.py
cinder/api/contrib/types_manage.py
cinder/backup/drivers/ceph.py
cinder/backup/drivers/swift.py
cinder/brick/iscsi/iscsi.py
cinder/image/glance.py
cinder/test.py
cinder/tests/api/contrib/test_qos_specs_manage.py
cinder/tests/api/v1/test_limits.py
cinder/tests/test_backup_ceph.py
cinder/utils.py
cinder/volume/api.py
cinder/volume/drivers/coraid.py
cinder/volume/drivers/emc/emc_smis_common.py
cinder/volume/drivers/glusterfs.py
cinder/volume/drivers/huawei/__init__.py
cinder/volume/drivers/huawei/rest_common.py
cinder/volume/drivers/ibm/gpfs.py
cinder/volume/drivers/ibm/ibmnas.py
cinder/volume/drivers/ibm/storwize_svc/__init__.py
cinder/volume/drivers/ibm/storwize_svc/helpers.py
cinder/volume/drivers/ibm/storwize_svc/ssh.py
cinder/volume/drivers/nfs.py
cinder/volume/drivers/rbd.py
cinder/volume/drivers/san/hp/hp_3par_common.py
cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py
cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py
cinder/volume/drivers/vmware/vim.py
cinder/volume/drivers/xenapi/lib.py
cinder/volume/flows/common.py
cinder/volume/manager.py
cinder/volume/qos_specs.py
cinder/volume/volume_types.py
cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py
cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py
cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py
cinder/zonemanager/fc_san_lookup_service.py
cinder/zonemanager/fc_zone_manager.py