VimExceptions need to support i18n objects
Bug #1374210 reported by
Davanum Srinivas (DIMS)
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Medium
|
James Carey | ||
oslo.vmware |
Fix Released
|
High
|
James Carey |
Bug Description
When lazy is enabled the i18n translation object does not support
str() which causes failures like:
UnicodeError: Message objects do not support str() because they may
contain non-ascii characters. Please use unicode() or translate()
instead.
tags: | added: vmware |
Changed in nova: | |
status: | New → Confirmed |
Changed in oslo.vmware: | |
status: | New → Confirmed |
Changed in nova: | |
importance: | Undecided → Medium |
Changed in oslo.vmware: | |
importance: | Undecided → High |
Changed in nova: | |
assignee: | nobody → James Carey (jecarey) |
Changed in oslo.vmware: | |
assignee: | nobody → James Carey (jecarey) |
milestone: | none → next-kilo |
Changed in oslo.vmware: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
status: | Confirmed → Invalid |
To post a comment you must log in.
Here is the failure when i18n lazy translation is enabled in Nova (note not enabled in Juno):
nova.tests. virt.vmwareapi. test_driver_ api.VMwareSudsT est.test_ exception_ with_deepcopy ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -
-------
Captured traceback: virt/vmwareapi/ test_driver_ api.py" , line 113, in test_exception_ with_deepcopy
copy.deepcopy, self.vim) nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 420, in assertRaises
self.assertTha t(our_callable, matcher) nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 431, in assertThat
mismatch_ error = self._matchHelp er(matchee, matcher, message, verbose) nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 481, in _matchHelper match(matchee) nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ matchers/ _exception. py", line 108, in match matcher. match(exc_ info) nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ matchers/ _higherorder. py", line 62, in match match(matchee) nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 412, in match
reraise( *matchee) nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ matchers/ _exception. py", line 101, in match nova/.tox/ py27/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 965, in __call__ object( *self._ args, **self._kwargs) python2. 7/copy. py", line 174, in deepcopy nova/.tox/ py27/local/ lib/python2. 7/site- packages/ oslo/vmware/ service. py", line 201, in request_handler nova/.tox/ py27/local/ lib/python2. 7/site- packages/ oslo/vmware/ exceptions. py", line 52, in __init__ nova/.tox/ py27/local/ lib/python2. 7/site- packages/ oslo/i18n/ _message. py", line 167, in __str__
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "nova/tests/
File "/opt/stack/
File "/opt/stack/
File "/opt/stack/
mismatch = matcher.
File "/opt/stack/
mismatch = self.exception_
File "/opt/stack/
mismatch = matcher.
File "/opt/stack/
File "/opt/stack/
result = matchee()
File "/opt/stack/
return self._callable_
File "/usr/lib/
y = copier(memo)
File "/opt/stack/
_("No such SOAP method %s.") % attr_name, excep)
File "/opt/stack/
self.msg = str(message)
File "/opt/stack/
raise UnicodeError(msg)
UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.