← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1187872] Re: `message` attribute of NovaException not updated

 

** Changed in: nova
       Status: Incomplete => Opinion

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

Title:
  `message` attribute of NovaException not updated

Status in OpenStack Compute (Nova):
  Opinion

Bug description:
  NovaException's objects have a `message` attribute which can be used
  to override the error message for an exception.

  The class can be given a default such as:

  class MyException(NovaException):
      message = _('myexception')

  For additional flexibility, we also have the ability to override this
  on a per-object basis by passing in a custom `message`, like:

  exc = MyException('foo')

  
  Now when we render the error message like `repr(exc)` we see 'foo' as expected.

  However if we try to inspect the exception's `message` attribute,
  counterintuitively, we still see 'myexception'.

  The solution here is, for clarity, to set the instance attribute
  `message` with the overridden value.

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