As noted by bcwaldon the parameter can be removed after updating
Devstack. Should be done after merging the following change:
https://review.openstack.org/#/c/39323/
Change-Id: I8d0f7ab4cccccf022446374a31e03ac913cfb136
When an error with non-ascii characters is caught by glanceclient, it
fails at printing it and exists with a UnicodeEncodedError. This patch
encodes errors' messages using strutils before sending them to stdout.
Fixes bug: #1200206
Change-Id: I4dabcd76ffb258840bd6a66ad23c030f34960e86
Fixes bug 1179392
glanceclient.common.http.HTTPClient.get_connection_kwargs method
explicitly sets the timeout to be a float, while struc.pack is
still using LL as the format string which means 2 Long Integers.
Setting format string to fL which mean a float followed by Long
Integer.
Also, Bad file descriptor error is caused by socket being closed
to soon. Added a close() implementation to VerifiedHTTPSConnection
which will remove reference to socket before returning call to
base HTTPConnection.close(). This will avoid socket to be closed
before response body is read. Socket will close when response
close is called.
Change-Id: I3a973da3b962c7572ae0f61f6996bdd1f0048339
This is a temporary solution. Increasing the default page size (which is being
used everytime, since the client is ignoring nova's --limit param). This should
decrease the number of queries that glance does when nova requests an image
detail list.
Bug 1200257
Change-Id: I7ed4521698570cbae9c20e69ddca8b11b57c65ad
There is an upcoming patch in nova which passes identity
headers to glance client. We want to ensure that these get
passed to glance, which in turn with help the no auth
option in glance.
Resolves bug 1200761
Change-Id: Ifbef582aa4e64a2e7a46db43a9cc6cf8c3531dbd
Currently, accessing a host via ip address will pass SSL verification;
the CNAME is not checked as intended as part of verify_callback.
'preverify_ok is True' will always return false (int/bool comparison).
preverify_ok will be 1 if preverification has passed.
Fixes bug 1192229
Change-Id: Ib651548ab4289295a9b92ee039b2aff2d08aba5f
Implement checksum image index property in the python-glanceclient
Change-Id: If1426b7938457014ef27a86d3902d53854161627
Implements: blueprint index-using-checksum-image-property
Added the CLI option image-tag-update to associate a tag to an image via API V2.
Added the CLI option image-tag-delete to delete a tag associated with an image via API V2.
Related to bp glance-client-v2
Change-Id: I76060e1982223770a6c2c0bd9376d568af0df456
Instead of globally ignoring pyflakes and
hacking warnings, only blacklist those that trigger
very frequently so far, in order to clean them
up in followup commits. Fix and start gating
on the rest already.
Change-Id: Ied7c7250061e3bf379e8286e8ce3b9e4af817faf
Glanceclient implemented both functions before they landed into oslo.
Since both functions are already in oslo, it is now possible to pull
them in.
There's a small difference between glance's implementation and oslo's,
that is the later does not convert non-str objects - int, bool - to str
before trying to decode / encode them. This patch takes care of that
where necessary, more precisely, while encoding headers before doing a
new request.
Fixes bug: #1172253
Change-Id: I9a0dca31140bae28d8ec6aede515c5bb852b701b
v1.images._image_meta_to_headers currently encodes headers as a way to
ensure they're an instance of basestring. This is not necessary since
headers will be encoded later during the request. Also, all data within
the client should be already decoded.
Fixes bug: #1187013
Change-Id: I80525adbc6e9e576cfad5b576090ef9ee574c1cf
For image-updae and image-create commands, glanceclient attempts to
determine whether image data should be uploaded based on the presence
of data on stdin. Unforunately it is difficult to determine if data is
available, especially when standard in is from a pipe.
This is especially problematic for update operations, where data must
only be uploaded if the image is in queued state. For example data may
be uploaded when the user only wants to rename an image, but the rename
will be rejected because data cannot be uploaded to an unqueued image.
This patch removes the check that attempts to determine if data is
available to read as it didn't work for pipes. It also re-introduces a
check for image state in the update operation, so that glanceclient only
attempts to read data if the image being updated is in queued state.
The image state check is part of the original patchset that was removed
so the patchset could have a single focus [1]
This patch also removes a test for handling empty stdin, and adds a test
for reading stdin from a pipe.
[1] https://review.openstack.org/#/c/27536/3/glanceclient/v1/shell.py
Fixes: bug 1184566
Related to: bug 1173044
Change-Id: I8d37f6412a0bf9ca21cbd75cde6a4d5a174e5545
* Check for available data size in v1/shell.py/_set_data_field, don't
read if 0.
* Add test_shell.py including tests for 3x stdin scenarios:
* closed
* open and empty
* open with data
Change-Id: I6ff65b0e226be509de9cd3f021560081529283b0
Fixes: bug #1173044
THe patch updates the importutils module and uses a per-line module
specification instead of the old modules= options.
Change-Id: Ieb28780bb9034fd61942305ff1eec21b3637027a
Convert non-ascii characters within image property (key/value pair) to
unicode but utf-8 to prevent provisioning failure when cloud using qpid
backend.
This change also make the image property encoding consistency between
the image updating and the receiving. Before this, image property
updating use unicode, but receiving (get) result is utf-8.
Fixes: Bug #1180377
Change-Id: I010760c598a7e008c79f1240255708265352cdb5
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Lists, creates, deletes, updates image members using glance
v2 api.
Related to bp glance-api-v2-image-members
Change-Id: Ic018a265a1676bb0a5638a55e70a527ce6b447fc
image-update --debug message no longer adds '-d "None"' to the curl command that
is output. This keeps the curl output consistent with the client
request.
Fixes bug #1172702
Change-Id: I34ceeb6f4a67c753ca3a805ec11240a99ce38ec4
If the glance client is instantiated when the socket module has been
monkey patched requests to the server can yield a WantReadError because
the socket has been set to non-blocking but this is not being handled
correctly. When this is the case use eventlet's GreenConnection which
handles non-blocking sockets correctly.
Also, for now, add a required getsockopt method to GreenConnection.
This can be removed once the eventlet fix
(https://bitbucket.org/eventlet/eventlet/commits/609f230) lands.
Fixes bug 1157864.
Change-Id: I187b69f75b8bcfe16facd41e69b1cd0490dae605
Some mechanical translation of the deprecated
except x,y construct. Should work with Python >= 2.6
just fine
Change-Id: I394f9956b9e3e3d9f5f1e9ad50c35b13200af2a1
handles the case where an image-update command is issued from a cron job with an
invalid standard input file descriptor: consider no image data is provided when
no --file option present.
Change-Id: I5eb3433311e5faf0a3fb7eb36f6a01e5df7efe4c
copy_from was ignored which resulted in "glance add" attempting to read from
stdout.
Fixes bug 1167899
Change-Id: I57fd85f7bb655bef69222d4fdf6b8274088ca827
When running the image-list command the user should have the option
to list images according to whether or not the image is was set
to public. A new test is included to verify this behavior.
Change-Id: If645e7390fcf850648cda780a04ea37a26d855a2
Fixes bug: 1118799
Currently a KeyboardInterrupt can be triggered by the user while the
client is communicating with keystone. This patch moves the trap
higher up in the stack.
Fixes bug: 1157905
Change-Id: I16889c2d97bc4694ab27c863c62c27333e264b60
When a user attempts to terminate the CLI with CTL+C a stack
trace is printed to the screen. When downloading files the
partial amount downloaded will not be cleaned up. In most
cases the user redirects to stdout, thus this program cannot
clean that up.
Fixes Bug: 1130390
Change-Id: If9f8ffc72b422d5dbd5969eecde8904238dd8860
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