Passing mutable objects as default args is a known Python pitfall.
We'd better avoid this. This commit changes mutable default args with
None.
Change-Id: I78323383c8b6a9a516a2a217303124870822418b
Glance client's setup.cfg was missing the wheels section. This commit
adds it and makes the client's setup.cfg consistent with other clients.
Change-Id: I16030c0379dae3c3c07bd73f09798c2160310811
This commit adds 2 more classifiers to setup.cfg. An environment
classifier that specifies glanceclient is a console tool and a
development classifier that specifies it is production ready.
Change-Id: Ia60ea76798503b0a729c384298f1a633d695a1ab
Glance client's setup.cfg was missing the license attribute. This commit
adds it to make it consistent with other clients and server libraries.
The value of the license attribute reflects the license in the LICENSE
file.
Change-Id: Ia2e8c3be4fe7eaf0db5eb397646068c83076c2ff
If --os-cacert was passed to the cli the following error was
triggered: "cafile must be None or a byte string". This is
because 'load_verify_locations' requires a byte string to
be passed in.
We fix this by explicitly converting the argument to a byte
string.
We do this in 'VerifiedHTTPSConnection' rather than sooner, eg
during arg handling, as it will no longer be required should we
move to a different http library (eg requests).
Fixes bug 1301849.
Change-Id: I9014f5d040cae9f0b6f03d8f13de8419597560cb
... and update tests to match.
The missing slash results in a non-absolute DELETE request
being sent to the API.
E.g.
DELETE v2/images/62fac489-23b4-4929-87af-2e7236e8542b HTTP/1.1
This is not strictly valid http/1.1 - rfc2616 specifies that the path must
be absolute.
This doesn't cause a problem for the API server, but this can cause
problems if the API server is fronted by something else (see #133161).
It also means that the curl command logged in debug mode has a
bad url.
E.g.
curl -i -X DELETE ... http://10.0.0.13:9292v2/images/...
Change-Id: Ib0c749dedbfcf07303fcddae4512db61b0f3fd78
Closes-bug: #1327101
Currently when an image is updated, the purge property
header is only set to true in some cases, but when
required it isn't set to false
Change-Id: I885a82643d2620f393f21c36b3ad95cb7ed43f2c
Closes-Bug: 1318079
This debug line is causing tracebacks in the n-cpu logs for
tempest runs. Its because the logged data is sometimes unicode:
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
msg = self.format(record)
File "/opt/stack/new/nova/nova/openstack/common/log.py", line 710, in format
return logging.StreamHandler.format(self, record)
File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
return fmt.format(record)
File "/opt/stack/new/nova/nova/openstack/common/log.py", line 674, in format
return logging.Formatter.format(self, record)
File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1234: ordinal not in range(128)
Logged from file http.py, line 153
The change used correct encoding error handling policy for the log
which may includes non-ascii char.
Closes-bug: 1320655
Change-Id: I97f5f14b9beddcceb7fbd371062caf5a38a62a20
Currently glanceclient's v2 commands don't support modification
operations on an image's location attribute - the argparse specification
for the location attribute of the image-update command causes the image
id argument to be included in list of locations and so the command
parsing fails (because it causes the image id to appear to be missing).
Furthermore even if the 'locations' argument were to be accepted by
argparse (e.g. by changing the argument specs and using --id to specify
the image id) the command would still fail because the arguments are
passed directly to the schema which expects the value of the 'locations'
argument to be a valid dictionary (there is nobody to convert the
argument string to a python dictionary that the schema expects).
This commit adds the following location related commands to
glanceclient:
--location-add: Add a new location to the list of image locations.
--location-delete: Remove an existing location from the list of
image locations.
--location-update: Update the metadata of existing location.
The glanceclient.v2.images.Controller class has been agumented with
three new methods to support the commands listed above:
- add_location
- delete_locations
- update_location
The server has not been modified, i.e. all location related API requests
are passed to the server via HTTP PATCH requests and handled by the
server's image update function.
The v2 'image' and 'shell' related tests have also been supplemented.
Note that in order to use these options the server must be first
configured to expose location related info to the clients (i.e.
'show_multiple_locations' must be set to 'True").
I also added a mailmap entry for myself.
DocImpact
Closes-bug: #1271452
Co-Author: David Koo (koofoss) <david.koo@huawei.com>
Change-Id: Id1f320af05d9344645836359758e4aa227aafc69
Add the type to the parameters that require an integer
in the V1 shell to avoid sending an improper request.
Change-Id: Idb1ed39b11ca737fdd42d24e297c142f28dce35c
Class `Managers` from `glanceclient.common.base` module is similar to
class `apiclient:ManagerWithFind` from common code.
In this patch:
- class glanceclient.common.base:Managers replaced by
apiclient:ManagerWithFind
- module glanceclient.common.base marked as 'deprecated'
Related to bp common-client-library-2
Change-Id: I41da4a9188e97ca2c07b6234fc2ac0a877553d3f
This module is obsolete and has been dropped from oslo-incubator.
Use six instead (which is already done here).
Change-Id: I8e0b49cdfbddcf2d44a601ad06be2e75897905fc
Currently, calls (create, get, etc.) return only the Image to a
caller. In order to log a mapping the request IDs of both glanceclient
and the caller, the x-openstack-request-id header value is needed on
the server side. This change allows that value to be bubbled up and
returned to the caller so that the appropriate logging can occur.
The return_req_id parameter can be set by services that are logging
request IDs. Glance's request ID will then be returned via the
return_req_id parameter.
This is a prerequisite for Log Request ID Mappings nova-spec to
be completed; Change Ib9b820a0feeb0c0e828ed3e4fab8261f8761ba9a
Change I43be05c351f901cee5509c76cff6d69f060c0b3f is an example of
a caller using this.
Implements: blueprint return-req-id
Change-Id: Ia82aa14db5f0e453010514fffb9a25d7b0fc2fd1
Currently only download method supports --progress flag in v2 API.
This patch let upload method in v2 API support this flag too.
Change-Id: I1d22379c320adb47a2178697e546413b9257f987
Closes-Bug: #1286265
Switch to using network_utils for splitting the URL. The code
in oslo-incubator supports ipv6 urls
Change-Id: I76be6173b97eb000319d30b4e9232a5a7c4a5aba
Closes-Bug: #1298137
Head of oslo-incubator is commit id:
2fd457bf2ccbeb2b84ffb204778b6417cd5405ba
includes a fix for gettextutil.Message handling of deep copy
failures and adding a license header
Change-Id: Ie89de1f95bb6fb9d11058413e682c441c39524f1
On assertEqual, the order of parameters should be (expected, observed).
But, some part of glanceclient v1 test were written with invalid order.
This patch fixes this problem.
Change-Id: If361309041a257c56bfc1fbbccf1b905839b0c18
Partially-bug: #1277104