cinder/cinder/tests/unit/integrated
Victor Stinner d08c7ffe52 Replace urllib and urllib2 with six.moves.urllib
The Python 2 urllib and urllib2 modules changed a lot in Python 3. On
Python 3, the urllib functions are now grouped into submodules of
urllib: urllib.parse, urllib.error, etc. The urllib2 has been removed.
Replace urllib and urllib2 with six.moves.urllib to make the Cinder code
compatible with Python 2 and Python 3.

The new code now looks like Python 3 code (ex: "urllib.parse.urlsplit"),
but it also works on Python 2.

Replace also "import six.moves.urllib.parse as urlparse" with "from
six.moves import urllib" to uniformize the code:
"urlparse.urlsplit(href)" becomes "urllib.parse.urlsplit(href)".

This patch was generated by the urllib operation of the sixer tool version 0.4:
https://pypi.python.org/pypi/sixer

Manual changes:

* Add a try/except ImportError to get the parse_http_list function
  in cinder/api/urlmap.py
* Import the socket module instead of using urllib2.socket
  in cinder/volume/drivers/huawei/rest_common.py
* test_nimble.py: replace NIMBLE_URLLIB2 value with
  'six.moves.urllib.request'
* Remove "from six.moves.urllib import parse as urlparse", it was
  replaced with urllib.parse from six.moves.
* Reformat to respect the 80 columns constraint

Change-Id: Ibd1e7bc83bbbd93a3634207fb277d25ef1b8a086
2015-06-10 18:52:26 +02:00
..
api Replace urllib and urllib2 with six.moves.urllib 2015-06-10 18:52:26 +02:00
__init__.py Move unit tests into dedicated directory 2015-04-21 18:40:40 -06:00
integrated_helpers.py Remove use of deprecated LOG.warn 2015-05-13 10:51:45 -05:00
test_extensions.py Fake out sleeps in unit tests 2015-05-01 15:38:34 -06:00
test_login.py Move unit tests into dedicated directory 2015-04-21 18:40:40 -06:00
test_volumes.py Remove use of deprecated LOG.warn 2015-05-13 10:51:45 -05:00
test_xml.py Remove use of deprecated LOG.warn 2015-05-13 10:51:45 -05:00