← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1447946] [NEW] nova report DeprecationWarning message when using exception.message

 

Public bug reported:

taget@taget-ThinkStation-P300:~/nova$ tox -e py27 nova.tests.unit.compute.test_flavors.CreateFlavorTestCase.test_create_flavor_ram_error 
py27 develop-inst-nodeps: /home/taget/nova
py27 runtests: PYTHONHASHSEED='0'
py27 runtests: commands[0] | find . -type f -name *.pyc -delete
py27 runtests: commands[1] | bash tools/pretty_tox.sh nova.tests.unit.compute.test_flavors.CreateFlavorTestCase.test_create_flavor_ram_error
running testr
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./nova/tests} --list 
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./nova/tests}  --load-list /tmp/tmpBqJXFX
{0} nova.tests.unit.compute.test_flavors.CreateFlavorTestCase.test_create_flavor_ram_error [0.086535s] ... ok

Captured stderr:
~~~~~~~~~~~~~~~~
    nova/tests/unit/compute/test_flavors.py:45: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
      self.assertIn("ram", e.message)


and this can be fixed by overwrite NovaException.message see [1]
[1] http://stackoverflow.com/questions/1319615/proper-way-to-declare-custom-exceptions-in-modern-python/26938914#26938914

** Affects: nova
     Importance: Undecided
     Assignee: Eli Qiao (taget-9)
         Status: Confirmed

** Changed in: nova
     Assignee: (unassigned) => Eli Qiao (taget-9)

** Changed in: nova
       Status: New => Confirmed

** Summary changed:

- nova report DeprecationWarning message is using exception.message
+ nova report DeprecationWarning message when using exception.message

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1447946

Title:
  nova report DeprecationWarning message when using exception.message

Status in OpenStack Compute (Nova):
  Confirmed

Bug description:
  taget@taget-ThinkStation-P300:~/nova$ tox -e py27 nova.tests.unit.compute.test_flavors.CreateFlavorTestCase.test_create_flavor_ram_error 
  py27 develop-inst-nodeps: /home/taget/nova
  py27 runtests: PYTHONHASHSEED='0'
  py27 runtests: commands[0] | find . -type f -name *.pyc -delete
  py27 runtests: commands[1] | bash tools/pretty_tox.sh nova.tests.unit.compute.test_flavors.CreateFlavorTestCase.test_create_flavor_ram_error
  running testr
  running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
  OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
  OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
  ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./nova/tests} --list 
  running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
  OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
  OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
  ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./nova/tests}  --load-list /tmp/tmpBqJXFX
  {0} nova.tests.unit.compute.test_flavors.CreateFlavorTestCase.test_create_flavor_ram_error [0.086535s] ... ok

  Captured stderr:
  ~~~~~~~~~~~~~~~~
      nova/tests/unit/compute/test_flavors.py:45: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
        self.assertIn("ram", e.message)

  
  and this can be fixed by overwrite NovaException.message see [1]
  [1] http://stackoverflow.com/questions/1319615/proper-way-to-declare-custom-exceptions-in-modern-python/26938914#26938914

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1447946/+subscriptions


Follow ups

References