1230 Commits

Author SHA1 Message Date
zheng yin
fa5bfbed41 Add Python 3.5 classifier and venv
There is a passing gate job, we can claim support for Python 3.5
in the classifier. This patch also adds the convenience py35 venv.

Change-Id: I15304210a7f32b719a910e22518d33427ddedbb9
2016-07-12 07:26:45 +08:00
Sabari Kumar Murugesan
d7db97c926 Fix warlock model creation
Commands like glance md-namespace-show <namespace> fail because
of a breaking change in warlock 1.3.0's model creation factory
method.

Warlock introduced a new kwarg 'resolver' in model_factory method
but changed its position with the 'base_class' kwarg. Since we
were calling the model_factory method with positional arg, this
broke the model creation.

Closes-Bug: #1596573

Change-Id: Ic7821f4fdb1b752e0c7ed2bc486299a06bf485c1
2016-07-06 18:18:42 -07:00
OpenStack Proposal Bot
f2c02830f6 Updated from global requirements
Change-Id: Iff3305ceda5ae1b7e938591eeeec2bf690e84ab8
2016-07-01 04:24:05 +00:00
Jenkins
b1b806fd0e Merge "Replace tempest_lib with tempest.lib" 2016-06-29 19:37:42 +00:00
Stuart McLaren
7ed22a91d3 image-download: tests to catch stray output
Add unit tests to ensure that any stray output (eg print
statements) during image-download cause a test failure.

Regression test for bug 1488914.

Change-Id: Ic19ba5693d059bf7c283702e7c333672a878a1a1
Partial-bug: 1488914
2016-06-29 16:08:30 +00:00
Jenkins
8a584d5938 Merge "Use correct order of arguments to assertEqual" 2016-06-29 16:04:35 +00:00
zhengyao1
c3de38ed53 Use correct order of arguments to assertEqual
The correct order of arguments to assertEqual that is expected by
testtools is (expected, observed).

This patch fixes the inverted usage of arguments in some places
that have cropped up since the last fix of this bug.

Change-Id: If8c0dcb58496bc2fcf4c635f384522a1f7d2b2af
Closes-Bug: #1259292
2016-06-29 03:46:30 +00:00
OpenStack Proposal Bot
d530fbd9c3 Updated from global requirements
Change-Id: I900450e96871910b116958f8129b980994c0538e
2016-06-28 18:55:15 +00:00
Mike Fedosin
29cfd07e17 Update outdated image shema
Image schema that is located in glance client
is seriously outdated, we need to updated it
and bring it in line with the server version.

Change-Id: I5a79a84a9c07b9ee821a71a5bd2d61cb4299ad72
2016-06-28 20:59:05 +03:00
wangxiyuan
cbb46434e6 Replace tempest_lib with tempest.lib
As the tempest_lib is deprecated and the code has been moved into
tempest. We should use tempest.lib insteded of tempest_lib.

Change-Id: Id22f90a47056cd88f9524fc6015607c93f7d88b5
2016-06-27 17:26:02 +08:00
Abhishek Kekane
96151efd51 Log request-id for each api call
Added support to log 'X-Openstack-Request-Id' for each api call.
If glanceclient is used from command line then following log will
be logged on console if --debug flag is used.

DEBUG:glanceclient.common.http:GET call to glance-api for
http://172.26.88.20:9292/v2/schemas/image used request id
req-e0c7c97a-8fc0-4ce3-a669-d0b1eb5d7aae

If python-glanceclient is used in applications (e.g. Nova) then
following log message will be logged in service logs.

DEBUG glanceclient.common.http
[req-be074f1e-1c17-4786-b703-2a221751c8f4 demo demo] GET call to
glance-api for
http://172.26.88.20:9292/v1/images/detail?is_public=none&limit=20
used request id req-9b1dd929-df30-46b2-a8f2-dfd6ffbad3fc

DocImpact:
To use this feature user need to set 'default_log_levels' in third
party application. For example nova uses glance then in nova.conf
'default_log_levels' should be set as below:

default_log_levels = glanceclient=DEBUG

Implements: blueprint log-request-id
Change-Id: Ib04a07bac41ad2a5e997348f3b0bccc640169dc9
2016-06-27 11:31:07 +05:30
OpenStack Proposal Bot
d168bd73eb Updated from global requirements
Change-Id: I2080edfcefa94d1c29f78b27bf84da44f32ddf58
2016-06-24 03:17:11 +00:00
OpenStack Proposal Bot
8ead51d9f4 Updated from global requirements
Change-Id: I1ee3b5f6f8547d9d2dc23ddd8f1b3f3688d733b1
2016-06-21 18:05:05 +00:00
Jenkins
985df912e1 Merge "Remove unused skip_authentication decorator" 2016-06-21 16:13:59 +00:00
OpenStack Proposal Bot
46c3792fee Updated from global requirements
Change-Id: Ida2080b0c209b87781313b2be92c957d22b3188c
2016-06-10 15:49:11 +00:00
kairat_kushaev
2ab2678140 Remove deprecated construct method from session init
construct method is marked as deprecated and might be deleted
in one of future releases. So glanceclient need to be aware of
that and initialize sesssion from command line arguments directly.

Change-Id: Ie81b62b7e70bb177f178caadc41554ae88e51b05
2016-06-09 19:31:02 +00:00
Niall Bunting
10ad2886e1 Add upper constraints to glanceclient
This will force pip install to use the upper-constraints.txt specified
version of pip modules. When you don't do this, you are out on the
bleeding edge and become unstable everytime some python library in the
world changes in a way that you don't expect.

The script is needed because it cleans up the conflicting entry that
corresponds to the client before applying it to source based installation.

Change-Id: I8f168fde04bf9e421d9a39e91a041512bf4f2b79
Closes-Bug: 1563038
2016-06-03 14:21:15 +00:00
kairat_kushaev
f58a73495f Remove unused skip_authentication decorator
skip_authentication is not used as decorator for glanceclient methods.
So this method can be safely removed from glance codebase because
it is artifact from old implementation.

Change-Id: I235b4c6b835c75266d8fae1bb603685aa17ad497
2016-06-02 13:25:30 +00:00
Mike Fedosin
e77322c179 Don't update tags every time
This code removes unnecessary PATCH requests
for tags updating if they were not modified.

Change-Id: I8eced32f39d0c98e0b26014e7b2341ab6580ff01
Closes-bug: 1587999
2016-06-01 21:02:29 +03:00
OpenStack Proposal Bot
28f905fb45 Updated from global requirements
Change-Id: Ibcb8da6b56adf4a8d6d814f81b8034899b54deef
2016-06-01 14:06:59 +00:00
Jenkins
561c33ccf0 Merge "[Trivial] Remove unnecessary executable privilege" 2016-06-01 13:54:15 +00:00
Jenkins
7dbbbfb542 Merge "Fixed grammar in image-download command description" 2016-06-01 13:37:57 +00:00
Ihar Hrachyshka
3a0007a1c3 Fixed grammar in image-download command description
Change-Id: Ie18e1bee3376fdc01685c6f1d3a949c6934296b3
2016-06-01 10:07:47 +00:00
OpenStack Proposal Bot
3ced7d5905 Updated from global requirements
Change-Id: I353dee7615434bfbc0ae76ed8c7ce168458065fc
2016-05-31 03:05:57 +00:00
OpenStack Proposal Bot
a1cd7ef609 Updated from global requirements
Change-Id: Ie88b8762b6db82dc26c6d652786d68ace6e002dd
2016-05-30 00:38:52 +00:00
OpenStack Proposal Bot
3296620f5e Updated from global requirements
Change-Id: Ic3499b5fdacf7602cbfec3720580790d1bda384c
2016-05-26 17:04:47 +00:00
Jenkins
6f2fae7a19 Merge "Fix "Codec can't encode characters"" 2016-05-23 14:31:04 +00:00
Abhishek Kekane
7d106c677a Revert "Add last_request_id member to HTTPClient and SessionClient"
This reverts commit 9e532db8b0f0ba537edef143a6f5380a2aaa1e4b.

If glanceclient is used in multi-threaded environment, then there is a
possibility of getting invalid/wrong last request-id. To avoid this,
need to use thread local storage to store last-request-id and add
public method to return this request-id to caller.

http://specs.openstack.org/openstack/openstack-specs/specs/return-request-id.html#alternatives

Change-Id: I08d8d87fc0cc291f1b930b2c0cfc110ec8394131
2016-05-23 14:14:55 +00:00
ZhiQiang Fan
3066256ba7 [Trivial] Remove unnecessary executable privilege
glanceclient/shell.py defines a main entry, however this file cannot
be executed directly because we do not call the main function in
this file. It is actually a module which will be used by
/usr/bin/glance, hence doesn't need to be executable.

Change-Id: I8b45ac7b8b88265cfc27e5ba7201e4766d9dc276
2016-05-21 13:17:41 +00:00
Jenkins
2e6f60502e Merge "Get endpoint if os_image_url is not set" 2016-05-19 16:57:27 +00:00
Darja Shakhray
9329ef0bc4 Fix "Codec can't encode characters"
Headers were encoded in HTTPClient, but when glance client started
to use SessionClient this functionality was lost.

This commit replaces static method "encode_headers" from HTTPClient
and makes it a common function, that SessionClient can use when
converting image meta to headers.


Change-Id: If9f8020220d2a0431b4241b38b9c83c09c0d75cb
Closes-bug: #1574587
2016-05-19 16:48:03 +00:00
Jenkins
fc06c9c120 Merge "Update the home-page with developer documentation" 2016-05-19 03:19:30 +00:00
Jenkins
6afc66e4e5 Merge "Updated from global requirements" 2016-05-18 22:05:54 +00:00
Jenkins
7150ceee1a Merge "Add last_request_id member to HTTPClient and SessionClient" 2016-05-18 21:44:53 +00:00
OpenStack Proposal Bot
f0dca77f0e Updated from global requirements
Change-Id: I86de9b2a73cae95dad02a01dbef96f78d9c39b88
2016-05-17 14:09:35 +00:00
venkatamahesh
f9dade5eda Update the home-page with developer documentation
Change-Id: I570ee3d8963292ebb1c0fef7e7794378c7f08e7e
2016-05-17 12:32:23 +00:00
Niall Bunting
a862196cfb Get endpoint if os_image_url is not set
If env['OS_IMAGE_URL'] is not set then None is returned. This is then
used ignoring the endpoint_type, service_type and region_name. This
patch will use those values if the endpoint is None.

Change-Id: I76cc527b05d2be75d3dbc33123a0d71be97fe25c
Closes-bug: #1579768
2016-05-12 12:47:35 +00:00
OpenStack Proposal Bot
f39647ab47 Updated from global requirements
Change-Id: I5f2cc15aae2b34f6d600fbd1c67c88c552aa1562
2016-05-06 22:22:12 +00:00
PranaliD
41e10e3690 Corrected wrong parameter in docstring
In docstring of list() method of glanceclient/v1/images.py,
parameter 'return_request_id' used within **kwargs is
'return_req_id', not 'return_request_id'.

Changed 'return_request_id' to 'return_req_id'.

Change-Id: I7f4a2a5af1b13184c67fa81be971dc5139569f8b
Closes-Bug: 1573049
2016-05-02 03:43:44 -04:00
Jenkins
9ffebbb25e Merge "Enable hacking checks" 2016-04-20 17:13:16 +00:00
OpenStack Proposal Bot
da22122450 Updated from global requirements
Change-Id: I84ad85d08fcee0556f43f7c9d2e98d4a42d8e395
2016-04-19 12:28:31 +00:00
Jenkins
12e92558e5 Merge "Re-enable stacktracing when --debug is used" 2016-04-18 17:04:57 +00:00
Tin Lam
cd5925bc60 Enable hacking checks
Enabled following hacking checks from tox.ini:
- H233 Python 3.x incompatible use of print operator
- H303 no wildcard import
- H404 multi line docstring should start with a summary

Change-Id: I2553bcd3e80c00acc08d135a1d2dadfb6cda49fe
Partial-Bugs: #1475054
2016-04-18 16:23:59 +00:00
Jenkins
cad0245885 Merge "Fix typos in docstrings and comments" 2016-04-13 16:35:37 +00:00
Dao Cong Tien
9faa9d47aa Fix typos in docstrings and comments
Update a comment to be more meaningful

Change-Id: Ie1aa46917c1a253db92a0dc819803a1d3e795b07
2016-04-11 09:08:02 +07:00
OpenStack Proposal Bot
c70578a4a8 Updated from global requirements
Change-Id: Ia41d3929e00cb08c9a3414043b22fe9604514fb4
2016-04-08 00:32:47 +00:00
Stuart McLaren
d0ec3a7ebb Re-enable stacktracing when --debug is used
Commit 1f89beb6098f4f6a8d8c2912392b273bc068b2e3 introduced the behaviour
that a stacktrace is printed if an exception is encountered.

This helped make the client more supportable:

 $ glance --debug image-list
  .
  .
  .
  File "glanceclient/common/http.py", line 337, in get_http_client
    xxx
 NameError: global name 'xxx' is not defined
 global name 'xxx' is not defined

The behaviour was lost at some point. This patch re-enables it.

Change-Id: I25fc8624797909d606590747f54b9cf649ade079
Closes-bug: 1563830
2016-04-07 15:42:51 +00:00
Jenkins
09e9272c59 Merge "Update auth_token before sending request" 2016-04-05 22:23:12 +00:00
Jenkins
8eaefe90a9 Merge "Fix v2 so that you can see the default help info" 2016-04-04 22:25:43 +00:00
Cao ShuFeng
9e532db8b0 Add last_request_id member to HTTPClient and SessionClient
apiclient.base.Resource.get method requires manager.client to have
last_request_id member. Otherwise get operation fails with
AttributeError exception.

Change-Id: I0ece85e3f61f2a7f176520ddf3ebee7792e51993
Closes-bug: 1552533
2016-03-30 13:56:27 +00:00