DeprecationWarning: BaseException.message has been deprecated as of Python 2.6

Bug #1479066 reported by Matt Riedemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Chuck Carmack
oslo.vmware
Fix Released
Undecided
ChangBo Guo(gcb)

Bug Description

I see these when running tests:

Captured stderr:
~~~~~~~~~~~~~~~~
    nova/virt/libvirt/volume/volume.py:392: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
      if ('device is busy' in exc.message or

Seems that bug 1447946 was meant to fix some of this but it only handles NovaException, not other usage.

We should be able to use six.text_type(e) for 'if str in e' type checks.

http://logstash.openstack.org/#eyJzZWFyY2giOiJtZXNzYWdlOlwiRGVwcmVjYXRpb25XYXJuaW5nOiBCYXNlRXhjZXB0aW9uLm1lc3NhZ2UgaGFzIGJlZW4gZGVwcmVjYXRlZCBhcyBvZiBQeXRob24gMi42XCIgQU5EIHByb2plY3Q6XCJvcGVuc3RhY2svbm92YVwiIiwiZmllbGRzIjpbXSwib2Zmc2V0IjowLCJ0aW1lZnJhbWUiOiI2MDQ4MDAiLCJncmFwaG1vZGUiOiJjb3VudCIsInRpbWUiOnsidXNlcl9pbnRlcnZhbCI6MH0sInN0YW1wIjoxNDM4MTA2MTkwOTI3fQ==

Revision history for this message
Matt Riedemann (mriedem) wrote :

Using this as a test:

http://logs.openstack.org/91/202391/13/check/gate-nova-python27/5cf9c7c/console.html

There are 15 hits of that deprecation warning in a normal unit test run.

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Changed in nova:
assignee: nobody → Chuck Carmack (chuckcarmack75)
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/207127

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Chuck Carmack (<email address hidden>) on branch: master
Review: https://review.openstack.org/207127

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/207560

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/207560
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=59f6abfa57091fd723aa6b1f9dc5ac028c0269c4
Submitter: Jenkins
Branch: master

commit 59f6abfa57091fd723aa6b1f9dc5ac028c0269c4
Author: Chuck Carmack <email address hidden>
Date: Thu Jul 30 17:45:24 2015 +0000

    Fix DeprecationWarning when using BaseException.message

    Some of the nova unit tests are getting:
    "DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 "
    when referring to the message attribute of the exception.
    Change to use "six.text_type(exception)" to avoid these warning.

    Change-Id: I6f2c83a66306cdaccb95a7be21214f15969b6947
    Closes-Bug: 1479066

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-rc1 → 12.0.0
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :
Changed in oslo.vmware:
assignee: nobody → ChangBo Guo(gcb) (glongwave)
status: New → In Progress
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/oslo.vmware 2.2.0

This issue was fixed in the openstack/oslo.vmware 2.2.0 release.

Changed in oslo.vmware:
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.