CLI image-update gives a wrong help on '--tags' param

The help message tells end user image-update interface accepts 'tags'
param and could be used to update tag of image [0], but actually it
could trigger an 400 exception [1] due to wrong PATCH calls, and the
correct way is to use image-tag-update interface [2] as designed.

[0] glance image-update <IMG_ID> --tags <TAG_VALUE>

[1] 400 Bad Request
    Invalid JSON pointer for this resource: '/tags/0'
        (HTTP 400)

[2] glance image-tag-update <IMG_ID> <TAG_VALUE>

Change-Id: Iaa8041779510192dc08f7b898b8a1beda29a6398
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Add a tox job for generating docs

Add a tox job to make it easier for developers to generate their
own docs before submitting a patch.

Change-Id: I1897407d0db901c61360a196b365b0661eb65b66
Update theme for docs

The current developer docs theme used is out of sync with the other
openstack projects. This patch will update the docs to provide a more
consistent look and feel when using developer docs

Change-Id: I4a59f194bd0fc8c86c6d3c6b8cadb839a5158935
Downgrade log message for http request failures

Downgrades the log message when an http request fails from error
to debug. The logging level changed in the http.py upgrade in
I09f70eee3e2777f52ce040296015d41649c2586a which effectively reverted
a similar fix commited in I6d0efb53d1e81adf309f7fa580ec5a8073a811c5.

We don't want to log at ERROR level because we already have an
exception raised and the caller can handle it if wants
to. However this error will appear regularly in the Nova logs
under normal behavior (say a client specifies an image which does
not exist) and there is no way of disabling only the glanceclient
error log. This results in a lot of noise in the nova log file.

Change-Id: Iec13bff439073a79cb24e9b22fd43603ae4e61b7
Add support for Keystone v3

This enables glanceclient to authenticate using Keystone v3
API and includes the addition of several new CLI arguments.

DocImpact

Change-Id: I863ba08d312363dc1ce4fc7822fb21ef53df1a4f
Fix glance-client to work with IPv6 controllers

Currently the glance client can't operate on IPv6 address based
openstack controller IPs. The reason for this is the absence of
creation of a IPv6 socket in the glance client code (in https.py).
The glance client is trying to create sockets from the AF_INET
socket family but this will lead to errors when glance client makes
a call on the IPv6 IP addresses.

In order to fix this limitation, we ensure that if the hostname
resolves to IPv6 or an explicit IPv6 address is used to configure
the openstack controller - glance client shall be able to detect
that and then create a AF_INET6 socket family. In all other cases
a AF_INET socket is created. We default to IPv4 sockets in all
other cases.

Change-Id: I7d5a09675cd5dab2e39f0faeaa7c169291eedac6
Closes-bug: #1348030
Normalize glanceclient requested service url

Some proxy or gateway softwares, e.g. jumpgate [0], use url-pattern
based approach to match which hanlding logic needs to be triggered for
particular service calling when it received a http(s) call as a
middleman. The change fixed an issue which caused glanceclient send out
the request to a dis-normal url, which contains duplicated "/".

The change removed a wrong and duplicated code snippet from curl logging
function as well.

[0] http://goo.gl/yt52X1

Change-Id: Ic8b3920e11d400771ead7f9c44b615f10b4a5cef
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Add support for Keystone v3"
Remove deprecated commands from shell

Remove all deprecated commands from the shell
since they are no longer used and to keep
the command line menu from looking cluttered.

Closes-bug: #1314218

Change-Id: I66e82872988e3835e4f290f48dfc80538271426c
Hide stderr noise in test output

Previously, some tests caused the usage options for glance to be printed out to
stderr. This patch redirects the stderr output for those unnecessarily verbose
test functions.

Change-Id: I781d35a16a97c9c093cb17288ebd96d3e1a2e4e9
Closes-Bug: #1334655
Merge "Normalize glanceclient requested service url"
Merge "Hide stderr noise in test output"
Enable osprofiler interface in glanceclient shell

To help end user uses profiling by glanceclient CLI directly, the
change added '--profile <HMAC_KEY>' argument to the shell.

This change also fixed a function regression, it was used to pass
necessary trace info to glance server via http header:
https://github.com/openstack/python-glanceclient/commit/dbb242b776908ca50ed8557ebfe7cfcd879366c8#diff-740dd7d9149f46fe4c01ef0ab7eb3bfbL196

In addition:
1. If client app want to enable profiling feature for glanceclient
object, please see: http://paste.openstack.org/show/85722/
2. Afer adding more trace point into Client object, as fundamental
requirement of osprofiler, what we need to notice caller is providing
correct messaging notifier in the context code.

The relevant change for glance server is ready at:
I45a19f5eb5304c2b78a9e12cbc0744941a807304

DocImpact

Change-Id: If42b69b2695a5f88536ecbc2c1b3592d9dbd880a
Signed-off-by: Zhi Yan Liu <lzy.dev@gmail.com>
Ensure server's SSL cert is validated

A bug was introduced which meant that the server SSL certificate was
not being verified. Here we make sure that it is checked (unless
the --insecure flag is used).

Helps guard against man-in-the-middle attack.

Change-Id: I08f30bf3906b6580c871729311343fa8eefda91b
Closes-bug: #1357430
Merge "Enable osprofiler interface in glanceclient shell"
Merge "Add a tox job for generating docs"
Merge "Update theme for docs"
Fix indentation in tox.ini

Previously, a tab was used to indent a line with a block of code which
otherwise uses eight spaces, causing it to display strangely in text
editors which do not have tabstop=8 set.

TrivialFix

Change-Id: I99a432373beebac912df88e6685db26e738bf654
Fix error when logging http response with python 3

Python 3 changed the semantics of dict.items() [0], which now returns a
iterable 'view' instead of a list of tuples. This has the repercussion
that you can no longer check for membership of a key using:

    key in dict.items()

This patch simply replaces that check with a test for the key existing
in the dict itself, rather than the items.

[0] http://legacy.python.org/dev/peps/pep-3106/

Closes-Bug: 1359880

Change-Id: I7c59b0432725b660c9fa7270cde2e07bf3ea77db
Import missing gettextutils._ in shell.py

Closes-Bug: #1355252

Change-Id: I3aef19235735b3b374b92985f142712cb0f37a35