Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I12e1a2a4a22116cabd09a3b808f871d98e4bd1f2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.iteritems' and 'six.iterkeys' can
be replaced by 'items' and 'keys', 'six.moves.urllib.parse'
can be replaced by 'urllib.parse', 'six.StringIO' and
'six.moves.cStringIO' can be replaced by 'io.StringIO',
'six.text_type' and 'six.string_type' are just 'str'.
Change-Id: I357968c6a1932856b1600f6c191966bc90cbc258
The IOStream was not able to encode characters out of range 128:
"UnicodeEncodeError: 'ascii' codec can't encode characters in
position 19-21: ordinal not in range(128)"
Change-Id: Ic95396a5cf73c49d332928857dc064819a6d7ea6
Closes-Bug: #1858421
In favor of the private i18n wrapper (_i18n), the public 'i18n' wrapper
has been deprecated for several releases. Each neutron CLI plugin
(not OSC plugin) should use its own i18n wrapper and the usage of
neutronclient.i18n wrapper was deprecated. It is time to drop this.
Also fixes test_exception.py which still consumed neutronclient.i18n.
Change-Id: I27a8ace2f31bea5e1d6bf8a5ebbbfa52a3228e73
If a multibyte string without unicode prefix 'u' is passed to
NeutronException in python 2, string subsitution will fail.
In python 2, multibyte string without 'u' prefix is encoded into bytes.
As a result a string substitution in NeutronException.__init__ will fail.
Change-Id: I1aa08b69fe119087a7a49fda768a24f85f0e7c76
Closes-Bug: #1235228
The definition of __str__ is different between py2 and py3.
__str__ should return a byte stream to make print(exc) work
in python2, but __str__ should return string type in python3.
six.python_2_unicode_compatible sets up __str__ and __unicode__
approriately.
Change-Id: I6c85ca8c4e6f86450ee390db81e3aa101293b846
Related-Bug: #1235228