Thanks for the extra information. Now I see that there is different behavior. Next I will try to see how the notifications look differently with the two versions.
(py27) ebalgib@elxa95hld12:~/upstream/git/oslo.serialization$ pip freeze | grep serialization
oslo.serialization==2.21.1
(py27) ebalgib@elxa95hld12:~/upstream/git/oslo.serialization$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> class MyException(Exception):
... def __init__(self, named_arg):
... super(MyException, self).__init__('message')
...
>>> from oslo_serialization import jsonutils
>>> print jsonutils.to_primitive(MyException(named_arg='alma'))
oslo_serialization/jsonutils.py:188: UserWarning: Cannot convert MyException('message',) to primitive, will raise ValueError instead of warning in version 3.0
"instead of warning in version 3.0" % (value,))
message
>>> print jsonutils.to_primitive(MyException(named_arg='alma'), convert_instances=True)
{}
>>>
---
(py27) ebalgib@elxa95hld12:~/upstream/git/oslo.serialization$ pip freeze | grep serialization
oslo.serialization==2.25.1.dev1
(py27) ebalgib@elxa95hld12:~/upstream/git/oslo.serialization$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyException(Exception):
... def __init__(self, named_arg):
... super(MyException, self).__init__('message')
...
>>>
>>> from oslo_serialization import jsonutils
>>> print jsonutils.to_primitive(MyException(named_arg='alma'))
MyException('message',)
>>> print jsonutils.to_primitive(MyException(named_arg='alma'), convert_instances=True)
MyException('message',)
>>>
Thanks for the extra information. Now I see that there is different behavior. Next I will try to see how the notifications look differently with the two versions.
(py27) ebalgib@ elxa95hld12: ~/upstream/ git/oslo. serialization$ pip freeze | grep serialization ion==2. 21.1 elxa95hld12: ~/upstream/ git/oslo. serialization$ python Exception) : _init__ ('message' ) to_primitive( MyException( named_arg= 'alma') ) ion/jsonutils. py:188: UserWarning: Cannot convert MyException( 'message' ,) to primitive, will raise ValueError instead of warning in version 3.0 to_primitive( MyException( named_arg= 'alma') , convert_ instances= True)
oslo.serializat
(py27) ebalgib@
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> class MyException(
... def __init__(self, named_arg):
... super(MyException, self)._
...
>>> from oslo_serialization import jsonutils
>>> print jsonutils.
oslo_serializat
"instead of warning in version 3.0" % (value,))
message
>>> print jsonutils.
{}
>>>
---
(py27) ebalgib@ elxa95hld12: ~/upstream/ git/oslo. serialization$ pip freeze | grep serialization ion==2. 25.1.dev1 elxa95hld12: ~/upstream/ git/oslo. serialization$ python Exception) : _init__ ('message' ) to_primitive( MyException( named_arg= 'alma') ) 'message' ,) to_primitive( MyException( named_arg= 'alma') , convert_ instances= True) 'message' ,)
oslo.serializat
(py27) ebalgib@
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyException(
... def __init__(self, named_arg):
... super(MyException, self)._
...
>>>
>>> from oslo_serialization import jsonutils
>>> print jsonutils.
MyException(
>>> print jsonutils.
MyException(
>>>
---