emit_event() is failing when locale/language is changed to other than english

Bug #1621392 reported by ymadhavi@in.ibm.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
Mitaka
Fix Released
Medium
Matt Riedemann

Bug Description

https://github.com/openstack/nova/blob/master/nova/virt/driver.py#L1439 is causing emit_event() failure

Even though debug is not on, this line is causing emit_event() method failure.

2016-09-07 01:57:36.286 89568 INFO nova_powervm.virt.powervm.driver [req-9ef673ff-6d82-4a8e-b1fc-b7b635bc5bc8 - - - - -] [instance: bbb4890e-4e7f-47aa-b18f-cac527085966] Sending life cycle event for instance state change to: running
2016-09-07 01:57:36.287 89568 ERROR nova.virt.driver [req-9ef673ff-6d82-4a8e-b1fc-b7b635bc5bc8 - - - - -] Exception dispatching event <LifecycleEvent: 1473227856.29, bbb4890e-4e7f-47aa-b18f-cac527085966 => [G'Startedฏูİı|]>: 'ascii' codec can't encode characters in position 82-86: ordinal not in range(128)

affects: tacker → nova
Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
assignee: nobody → Matt Riedemann (mriedem)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/367455
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2b57b3d867f568a1539d4419b441ae8d666b77c4
Submitter: Jenkins
Branch: master

commit 2b57b3d867f568a1539d4419b441ae8d666b77c4
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 8 11:14:52 2016 -0400

    virt: handle unicode when logging LifecycleEvents

    The repr on the LifecycleEvent object includes a translated
    name, which blows up with a UnicodeEncodeError in the emit_event
    method because of str(event) and non-English locales.

    This change uses six.text_type on the object rather than str
    and adds a test to recreate the bug and show the fix.

    Change-Id: I9b7b52739883043b7aae9759f500e5e21cfe8b30
    Closes-Bug: #1621392

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/mitaka)

Reviewed: https://review.openstack.org/368344
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=53a5d12ad55d5946d917455ef6478c94e724043c
Submitter: Jenkins
Branch: stable/mitaka

commit 53a5d12ad55d5946d917455ef6478c94e724043c
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 8 11:14:52 2016 -0400

    virt: handle unicode when logging LifecycleEvents

    The repr on the LifecycleEvent object includes a translated
    name, which blows up with a UnicodeEncodeError in the emit_event
    method because of str(event) and non-English locales.

    This change uses six.text_type on the object rather than str
    and adds a test to recreate the bug and show the fix.

    Change-Id: I9b7b52739883043b7aae9759f500e5e21cfe8b30
    Closes-Bug: #1621392
    (cherry picked from commit 2b57b3d867f568a1539d4419b441ae8d666b77c4)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.0.0rc1

This issue was fixed in the openstack/nova 14.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 13.1.2

This issue was fixed in the openstack/nova 13.1.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.0.0rc1

This issue was fixed in the openstack/nova 14.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 13.1.2

This issue was fixed in the openstack/nova 13.1.2 release.

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.