Errors in name resolution have been logged previously with the url path
rather than the hostname. That resulted in incorrect errors like:
InvalidEndpoint: Error finding address for
/v1/images/detail?is_public=none&limit=20: [Errno -2]
Name or service not known
rather than one mentioning hostname itself. This patch changes the log
message to fit the situation.
Change-Id: I1eecbcb22d41b1341c214937b9cbfd046fd301a0
Currently glanceclient doesn't support non-ASCII characters for images
names and properties (names and values as well). This patch introduces 2
functions (utils.py) that will help encoding and decoding strings in a
more "secure" way.
About the ensure_(str|unicode) functions:
They both try to use first the encoding used in stdin (or python's
default encoding if that's None) and fallback to utf-8 if those
encodings fail to decode a given text.
About the changes in glanceclient:
The major change is that all inputs will be decoded and will kept as
such inside the client's functions and will then be encoded before
being printed / sent out the client.
There are other small changes, all related to encoding to str,
around in order to avoid fails during some conversions. i.e: quoting
url encoded parameters.
Fixes bug: 1061150
Change-Id: I5c3ea93a716edfe284d19f6291d4e36028f91eb2
When using 'insecure' no callback is executed.
Make it more obvious that the set_verify callback
won't be called by replacing it with a lambda.
Fixes bug 1112361.
Change-Id: Ib5d43a8883f7ed76383971d8154e2111f5ab2869
If the image id contains a space it needs to be quoted or else
it will construct an improper header.
Fixes bug 1111948
Change-Id: I4db2e74401b57de9666d40b38151182b2a76cd1b
The image-update help page reversed the DISK_FORMAT
and CONTAINER_FORMAT metavars.
Fixes bug #1111054
Change-Id: Iec8374782d00e8e9102141fb1e1c16d7f6ac136c
VerifiedHTTPSConnection inherits from HTTPSConnection so 'port' should be
an optional argument. If not present it will be set by HTTPSConnection
in the usual way: by parsing the host string (eg 'localhost:8443')
or setting to the default of '443'.
Addresses bug 1102944.
Change-Id: I2c2cb92f824acf15b0ff54590b5614cf206b57e0
Now a user should specify ID as an image by glance command, and I feel
it is easy-use that a user can specify name also as an image like nova
command(ex. "nova boot").
By applying this patch, a user can specify name as image like the
following examples:
$ glance image-show cirros-0.3.0-x86_64-uec
$ glance image-update --name root-fs cirros-0.3.0-x86_64-uec
$ glance image-delete cirros-0.3.0-x86_64-uec
$ glance image-download cirros-0.3.0-x86_64-uec
$ glance member-create cirros-0.3.0-x86_64-uec 94b0e63a27ca43348fe056622fe3fe94
$ glance member-delete cirros-0.3.0-x86_64-uec 94b0e63a27ca43348fe056622fe3fe94
Fixes bug 1093380
Change-Id: Ia0a070eed6ae3853ef02032f479087edb1d75a67
Current glance command does not show the details of error message.
For example, the glance command shows HTTPBadRequest only if some
necessary parameter is not specified.
$ glance image-create --file root-fs.img --name cirros-0.3.0-x86_64-uec
Request returned failure status.
HTTPBadRequest (HTTP 400)
$
By only the above message, it is not easy that a user understand the reason
of an error. glance-api server returns the details of reason, but glance
command does not show it.
This patch adds details, which is gotten from glance-api server, to error
message. And a user will be able to understand the reason of a error like
the following:
$ glance image-create --file root-fs.img --name cirros-0.3.0-x86_64-uec
Request returned failure status.
400 Bad Request
Invalid disk format 'None' for image.
(HTTP 400)
$
Fixes bug 1094917
Change-Id: I49192c3ebbc8a70b63dcfcede9fd13f1688388cf
* Rename --ca-file to --os-cacert (--ca-file deprecated for
backward compatibility)
* Add cacert to keystoneclient initialization to verify the
keystone server certificate
This aligns glanceclient with keystoneclient for option naming
and the use of TLS for the keystone auth connection. It does not
change the use of TLS/SSL for the glance connection.
Change-Id: If8b05655aea5f3c62612d77bf947dd790f77eddf
The --sort-key and --sort-dir CLI options allow users to control the
field and direction by which their images are sorted in an image-list
operation. The previous default sort behavior of sorting by ID asc has
been preserved.
Fixes bug 1082957.
Change-Id: I1d3664219c275b0379fe176f8288d6ffae0dffbe
Standardize pep8 to 1.3.3 and cleared up any errors
found by pep8 tests.
Change-Id: Ib7eb97d0789556d1676ccad58b5d3364065b7d15
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Add a command line arg "--store" to "glance image-create" so users
can specify a store other than the default on image creation.
Change-Id: Icf9a894b08e405d6884964b3cfaa80250e85ed71
When using https verify that the Common Name (CN) or
the Subject Alternative Name listed in the server's
certificate match the host we are connected to.
Addresses LP bug 1079692.
Change-Id: I24ea1511a2cbdb7c34ce72ac704d7b5e7d57cec2
Connect the --os-region-name option passed through the CLI
to the call to service_catalog.url_for.
Fixes bug 1080739.
Change-Id: I2d19d62a999a82a91de3883db12bbc24e900de25
* Limit human-readable sizes to a single decimal
* Drop trailing zero
* Step one suffix further in the case of a size being 1024
Change-Id: I2eb8ac0571d3d08b52f62155912863870573a37c
By introducing the parameter --human-readable for several functions
(image-list, image-show, image-update, image-create) it's possible
to convert the size in bytes to something more readable like
9.309MB or 1.375GB.
Change-Id: I4e2654994361dcf330ed6d681dbed73388f159cb
The boolean flags --is-protected and --is-public now
communicate that they must be set to True or False.
Fixes bug 1056501.
Change-Id: I23094ea556eb71d6eb977a64c171119738ed792b
Fixes Bug #1079323
python-glanceclient (latest repository code) fails on Windows due to a
malformed API url. This error is due to the usage of os.path.normpath(),
which should not be used for URLs as it swaps "/" with "\" on Windows.
The fix consists in using posixpath.normpath().
Please see also https://bugs.launchpad.net/nova/+bug/1077125 and related
commit.
Change-Id: Iaa643bd579963ad9ffbf10674973cbca75d435ac
Fixes bug 1056499.
Added a line to the help text of --checksum which enhances the help text
to show what checksum algorithm is expected.
Change-Id: Ie6604022dd9f398c639afe647b2d94b5179dbb61
Fixes Bug #1052161
"python setup.py build" fails on Windows due to a hardcoded shell path:
/bin/sh
setup.py updated using openstack-common/update.py
Change-Id: If0ae835aeada8769e46dddf4f3c2f2edfdfbc5fe
Add nargs to argparse for image-delete command to
allow muliple (optional) positional image-id arguments.
For example:
image-delete xxx aaa yyy will delete valid images
xxx and yyy and print error message for invalid image
aaa. Also with --verbose you can see some extra text
on delete request for each image.
Fixes bug1056498.
Change-Id: I6e804700ed24d16f90ec92569c0893cad4aaa26f
Use pyOpenSSL for HTTPS connections.
This allows:
* Neater loading of system CA files
* Optional disabling of SSL compression
The performance gain from disabling SSL compression is significant
in cases where the image being uploaded/downloaded is in an already
compressed format (eg qcow2).
Related to bp ssl-connect-rework.
Change-Id: I0568b6c95c5fc7b8eafdbd0284e24c453660a55a