Support glance client can get ipv6 image url correctly

This patch is for fix bug 1208784. In openstack ipv6 environment,
if the os image url is not provided, need use the provided host
to generate literal ipv6 image url.

Fixes bug 1208784

Change-Id: Icb71241a639db02d079348f086bd7bd5f0412609
Merge "Support glance client can get ipv6 image url correctly"
Fix default value for a header

This code specified None as the default value, but it would raise an
exception if that was ever returned.  An empty string causes the code to
work as intended.

This came up while I was writing a unit test for another bug fix.

Change-Id: I658bb8a9b5124f281988fb60b645182ea0ccf99f
Related-bug: #1231524
Fix getting header in redirect processing

The code for processing an HTTP redirect included an incorrect method of
getting the Location header from an HTTPResponse.  It needs to use the
getheader() method on the response, instead.  This patch fixes that and
includes a unit test that covers this code path.

Change-Id: I0952fabad581b020dee07bdc4007b55b47c906aa
Closes-Bug: #1231524
Fix regression bug after removing posixpath in http.py

After removing posixpath.normpath(url) in http.py, the code has a
regression bug that the url like 'http://example.com:80/test' can
not work. The code urlparse.urljoin() can not work as '%s%s' %
(self.endpoint_path, url).

Fixes bug #1230032

Change-Id: Ie7266fc3a067b92dfeed169086b4bf6a87dedbd6
Add CLI for V2 image create, update, and upload

Provides command line support for image-create, image-update,
and image-upload using the Glance V2 API. This includes building
help text for create and update based on the image jsonschema
as fetched from the server.

Also fixes bug caused by default warlock patch generation not
matching what Glance expects when updating a core property
which had not originally been set when the image was created.

Related to bp glance-client-v2

Change-Id: I841f9e3d05802f4b794cb6f4849abe03ff0324d9
Fix misused assertTrue in unit tests

Refactored unit tests to use assertEqual instead of assertTrue
where needed.

Closes-Bug: #1226374

Change-Id: I5f3b582e19f3461a04b5df05960095779ec8aa1a
Merge "Fix default value for a header"
Merge "Fix getting header in redirect processing"
Merge "Fix regression bug after removing posixpath in http.py"
python3: use six.moves for httplib imports

This adds six to the requirements.txt file in order to make
some HTTP-related imports work across Python 2's httplib and Python 3's
http.client modules. Tests were updated, including one change to the
location of HTTPConnection - moving it from being accessed where it was
imported rather than its canonical location inside of
six.moves.http_client.

Change-Id: Ibc4932b37dfdf195cd5091066914513af1876955
Signed-off-by: Chuck Short <chuck.short@canonical.com>