Message objects do not support str()

Bug #1730356 reported by Henry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powervc-driver
Fix Released
Undecided
Henry

Bug Description

When creating process of cinder-powervc, due to the incorrec config file in keystone connection, but it shows an other error message like this:

2017-06-02 21:27:28.119 2570 CRITICAL cinder [req-3134fa31-aa77-469f-8d28-6f60d4d915f2 - - - - -] UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.

2017-06-02 21:27:28.119 2570 TRACE cinder Traceback (most recent call last):

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/.venv/bin/cinder-volume", line 20, in <module>

2017-06-02 21:27:28.119 2570 TRACE cinder sys.exit(main())

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/cinder/cinder/cmd/volume.py", line 73, in main

2017-06-02 21:27:28.119 2570 TRACE cinder binary='cinder-volume')

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/cinder/cinder/service.py", line 249, in create

2017-06-02 21:27:28.119 2570 TRACE cinder service_name=service_name)

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/cinder/cinder/service.py", line 129, in __init__

2017-06-02 21:27:28.119 2570 TRACE cinder *args, **kwargs)

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/cinder/cinder/volume/manager.py", line 219, in __init__

2017-06-02 21:27:28.119 2570 TRACE cinder is_vol_db_empty=vol_db_empty)

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/.venv/local/lib/python2.7/site-packages/oslo_utils/importutils.py", line 38, in import_object

2017-06-02 21:27:28.119 2570 TRACE cinder return import_class(import_str)(*args, **kwargs)

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/.venv/local/lib/python2.7/site-packages/oslo_utils/importutils.py", line 27, in import_class

2017-06-02 21:27:28.119 2570 TRACE cinder __import__(mod_str)

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/powervc-driver/cinder-powervc/powervc/volume/driver/powervc.py", line 57, in <module>

2017-06-02 21:27:28.119 2570 TRACE cinder from powervc.common.client import factory

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/powervc-driver/cinder-powervc/powervc/common/client/factory.py", line 78, in <module>

2017-06-02 21:27:28.119 2570 TRACE cinder initialize_local_servicecatalog()

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/powervc-driver/cinder-powervc/powervc/common/client/factory.py", line 69, in initialize_local_servicecatalog

2017-06-02 21:27:28.119 2570 TRACE cinder LOG.info(_('Keystone service is not ready. ' + str(e)))

2017-06-02 21:27:28.119 2570 TRACE cinder File "/opt/openstack/.venv/local/lib/python2.7/site-packages/oslo_i18n/_message.py", line 167, in __str__

2017-06-02 21:27:28.119 2570 TRACE cinder raise UnicodeError(msg)

2017-06-02 21:27:28.119 2570 TRACE cinder UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.

According to error information, It should be use unicode but not str to show error message.

Henry (guanzy)
Changed in powervc-driver:
assignee: nobody → Henry (guanzy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to powervc-driver (master)

Fix proposed to branch: master
Review: https://review.openstack.org/517923

Changed in powervc-driver:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to powervc-driver (master)

Reviewed: https://review.openstack.org/517923
Committed: https://git.openstack.org/cgit/openstack/powervc-driver/commit/?id=161721311a9534e61c3cefd2d14edd5ca34bd308
Submitter: Zuul
Branch: master

commit 161721311a9534e61c3cefd2d14edd5ca34bd308
Author: guanzuoyu <email address hidden>
Date: Mon Nov 6 19:21:54 2017 +0800

    Modify incorrect method to translate error message

    When process of powervc-drver connecting keystone failed, it would
    give the error message in factory.py, but message objects do not
    support str(), so it needs to be modified by using unicode.

    Change-Id: I45bbb488300a5fe5c4e4f71265c3abacd775f41d
    Closes-Bug: #1730356

Changed in powervc-driver:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.