Commit Graph

1142 Commits

Author SHA1 Message Date
Jenkins 4682d403d2 Merge "Remove log translations" 2017-06-19 19:13:08 +00:00
Jenkins a2d1d8ce8a Merge "gitignore: Ignore auto-generated docs" 2017-06-19 15:40:17 +00:00
Jenkins 37a41017c5 Merge "doc: Remove cruft from conf.py" 2017-06-15 21:13:17 +00:00
OpenStack Proposal Bot a86fe0a252 Updated from global requirements
Change-Id: Ie04111374dc4769a641aa25619d0732f9f07cbea
2017-06-10 21:47:49 +00:00
OpenStack Proposal Bot d3d405cfb2 Updated from global requirements
Change-Id: I9fc075327f46c4b4e28f4dbb0bd4275dc5c2871c
2017-06-02 22:06:26 +00:00
Jenkins d67b33b2e5 Merge "Allow global_request_id in Client constructor" 2017-06-01 17:22:55 +00:00
Sean Dague ec76e254da Allow global_request_id in Client constructor
This allows us to pass in a global_request_id in the client
constructor so that subsequent calls with this client pass that to the
servers. This enables cross project request_id tracking.

oslo spec I65de8261746b25d45e105394f4eeb95b9cb3bd42

Change-Id: Iea1e754a263a01dae5ed598fdda134394aff54b0
2017-06-01 14:32:03 +00:00
Abhishek Kekane 60c06d526c Downloading image with --progress fails
Downloading image with --progress fails with "RequestIdProxy object is
not an iterator". This is because to display download progress
VerboseFileWrapper in progressbar requires object of IterableWithLength,
but after support of returning request-id [1] to caller it returns
RequestIdProxy object which is wrapped around IterableWithLength
and response.

To resolve this issue overridden next and __next__ methods in
RequestIdProxy so that it can act as iterator for python 2.x
and 3.x as well.

[1] 610177a779

Closes-Bug: #1670464
Change-Id: I188e67c2487b7e4178ea246f02154bbcbc35a2b1
2017-05-29 17:56:11 +05:30
Jenkins 3338ed91d4 Merge "Downloading image with --progress fails for python3" 2017-05-29 11:54:55 +00:00
OpenStack Proposal Bot f7598479d1 Updated from global requirements
Change-Id: Ic7656a41fcff3f1f5c47526d54f2254bc9a09c6b
2017-05-24 23:21:59 +00:00
ckonstanski 03900522d4 v2: Content-Type: application/octet-stream header always added
The bug: any existing Content-Type header cannot be found because the
call to headers.get() fails. Therefore we end up with two Content-Type
headers because a new one (applicaion/octet-stream) gets added
unconditionally. The cause: the strings (keys and values) in the headers
dict are converted from unicode sequences of type <str> to utf-8
sequences of type <bytes>. This happens in safe_encode()
(oslo_utils/encodeutils.py:66). <str> != <bytes> even if they appear to
have the same characters.

Hence, for python 3.x, _set_common_request_kwargs() adds content-type
to header even if custom content-type is set in the request.

This results in unsupported media type exception when glance client
is used with keystoneauth and python 3.x

The fix: follow the directions in encode_headers().
It says to do this just before sending the request. Honor this principle;
do not encode headers and then perform more business logic on them.

Change-Id: Idf6079b32f70bc171f5016467048e917d42f296d
Closes-bug: #1641239
Co-Authored-By: Pushkar Umaranikar <pushkar.umaranikar@intel.com>
2017-05-19 19:02:00 +00:00
Eric Fried 7df87fd4a2 Convert IOError from requests
This requests commit [1] changed the behavior when a nonexistent cacert
file is passed in: now it raises IOError.  This is getting through
glanceclient.common.http.HTTPClient._request, which used to raise
CommunicationError in this scenario.

Even though there is arguably a better exception than CommunicationError
to represent this condition (like maybe IOError), for backward
compatibility this change set converts IOError to CommunicationError.

We also improve the unit test to raise the original exception if the
expected conditions aren't met; this improves debugability.

[1] https://github.com/kennethreitz/requests/commit/7d8b87c37f3a5fb993fd83eda6888ac217cd108e

Change-Id: I6a2cf4c6d041b67d3509153b4cef18b459263648
Closes-Bug: #1692085
2017-05-19 14:59:58 -04:00
Abhishek Kekane bb2a5e946f Downloading image with --progress fails for python3
Downloading image with --progress fails for python3 with,
TypeError: 'IterableWithLength' object is not an iterator. This
is because IterableWithLength class does not implemented python3
compatible __next__ method.

Added __next__ method for python3 compatibility.

Change-Id: Ic2114180fac26e9a60678f06612be733e8671bdb
Closes-Bug: #1671365
2017-05-18 11:42:35 +05:30
OpenStack Proposal Bot a0edf0c2bf Updated from global requirements
Change-Id: If6412272a017a0887b00a33e68a00966ab8d1441
2017-05-03 12:22:23 +00:00
OpenStack Proposal Bot 79f96c5f4d Updated from global requirements
Change-Id: I3f45a69b0c70271b3b6b40035500f07b66758c21
2017-05-01 13:40:05 +00:00
Stephen Finucane 26a8572039 gitignore: Ignore auto-generated docs
Change-Id: I34b0a426bc10749e0b206aee9c8f7bdf3aea002f
2017-04-20 09:40:19 +01:00
Stephen Finucane 50eaad2249 doc: Remove cruft from conf.py
Change-Id: I1bbb2d490f0415e4062da520e6fb09e6db477aa0
2017-04-20 09:40:19 +01:00
Stephen Finucane 0e2e3f4372 Use Sphinx 1.5 warning-is-error
With pbr 2.0 and Sphinx 1.5, the setting for treat sphinx warnings as
errors is setting warning-is-error in build_sphinx section. Enable this.

Change-Id: I39ffb22c37a05f00cade2fbd14449eaf77dc3d39
2017-04-20 09:40:15 +01:00
Stephen Finucane bd42145923 Explicitly set 'builders' option
An upcoming release of pbr will require explicitly stating which
builders are requested, rather than defaulting to html and man. Head off
any potential impact this may cause by explicitly setting this
configuration now.

Change-Id: I94098478dd80fd8c41f63d192422c6240f3cd92a
2017-04-19 10:25:50 +01:00
OpenStack Proposal Bot 92f97576f3 Updated from global requirements
Change-Id: Idd8453b0c37e991dbd80260664c775539baa7c0c
2017-04-12 04:21:02 +00:00
OpenStack Proposal Bot a9a8cc56ba Updated from global requirements
Change-Id: I8c9321e6dca3b6c66e1341fa4b66d3cfb7228362
2017-04-07 06:15:34 +00:00
lijunbo 07ad860d07 Remove references to Python 3.4
Now that there exists only a gate job for Python 3.5 and not 3.4,
we should remove those references to the 3.4 that is untested.

Change-Id: I8853fadc29823b16fb4b620648636d658ec38d8d
2017-03-24 01:52:08 +00:00
wangzhenyu 36d2358a9d Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: Icf6423763f2d535b2c85c067d6e4a5676914e2c3
2017-03-21 07:19:21 +08:00
Jenkins ba46e69eee Merge "Replace functions 'dict.get' and 'del' with 'dict.pop'" 2017-03-06 17:09:00 +00:00
OpenStack Proposal Bot 333494a6d0 Updated from global requirements
Change-Id: I04411a2a10fc9587fbe61859b2a8597d8375fcdf
2017-03-03 22:58:20 +00:00
Jenkins 1268ca5333 Merge "Updated from global requirements" 2017-03-03 21:47:05 +00:00
Jenkins 0b77214f03 Merge "x-openstack-request-id logged twice in logs" 2017-03-03 20:56:25 +00:00
OpenStack Proposal Bot 7752c4a434 Updated from global requirements
Change-Id: Ib0bd11e18e336c86e66045a256e0befe90f0f56b
2017-03-02 11:54:22 +00:00
ricolin 70f27293bd Update test requirement
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848

Change-Id: I131cce2efade625af3e1e36a058c086ea5793f47
2017-03-02 16:35:24 +08:00
OpenStack Proposal Bot 5f1ae538e0 Updated from global requirements
Change-Id: I33e7b23e1c47148b9b1b29b7c05d6c2d88dcd065
2017-03-01 04:15:29 +00:00
Abhishek Kekane 87e4f7646f x-openstack-request-id logged twice in logs
In the recent release of keystoneauth1 2.18.0 provision is made to log
x-openstack-request-id for session client. Once this new library is synced
in openstack projects, the x-openstack-request-id will be logged twice
on the console if session client is used.

For example,
$ glance --debug image-list

DEBUG:keystoneauth.session:GET call to image for
http://10.232.48.204:9292/v2/schemas/image used request id
req-96a3f203-c605-4c96-a31d-f1199d41705c

DEBUG:glanceclient.common.http:GET call to glance-api for
http://10.232.48.204:9292/v2/schemas/image used request id
req-96a3f203-c605-4c96-a31d-f1199d41705c

Above log will be logged twice on the console.

Removed logging of x-openstack-request-id in case of SessionClient as it
is already logged in keystoneauth1. x-openstack-request-id will only be
logged once on console if HTTPClient is used.

Depends-On: I492b331ff3da8d0b91178bf0d5fe1d3702f15bd7
Closes-Bug: #1657351
Change-Id: I64258f997dc060113f53682aee74bdd40a346e54
2017-02-22 01:49:22 +05:30
OpenStack Proposal Bot 1cd7030c8f Updated from global requirements
Change-Id: I082f5baf52318187aa0f7d32a25d23d033255218
2017-02-11 17:51:14 +00:00
OpenStack Proposal Bot 7ba2ac7bf9 Updated from global requirements
Change-Id: I366cd5564fd786ad990d0902586aa6396613e7fc
2017-02-10 05:58:36 +00:00
bhagyashris 6740f57096 Replace functions 'dict.get' and 'del' with 'dict.pop'
Refactoring code: Making dict to use single instruction: pop()
rather than two instructions: get() and del, giving the codes a
format that carries through.

TrivialRefactoring

Change-Id: Idb21df37c287fdff24c29153676f82544f735297
2017-01-31 10:09:28 +05:30
Jenkins c1f54742f9 Merge "Replace dict.iteritems() with dict.items()" 2017-01-24 22:34:49 +00:00
OpenStack Release Bot d532d50663 Update reno for stable/ocata
Change-Id: Iba4cf2b4e14d1d2573e93396325ddb830787387c
2017-01-24 17:33:12 +00:00
OpenStack Proposal Bot 9afb56c875 Updated from global requirements
Change-Id: Ie074e23e82e89511100e65f88da18676f47bd7c6
2017-01-23 23:51:45 +00:00
Jenkins 99cbde26ac Merge "Add support for community images" 2017-01-23 22:19:37 +00:00
Jenkins a76fdcd20a Merge "Add request id to returned objects" 2017-01-23 22:19:31 +00:00
Ravi Jethani 610177a779 Add request id to returned objects
Adding two classes RequestIdProxy and GeneratorProxy derived from
wrapt.ObjectProxy to wrap objects returned from the API.

GeneratorProxy class is used to wrap generator objects returned
by cases like images.list() etc. whereas RequestIdProxy class is
used to wrap non-generator object cases like images.create() etc.

In all cases the returned object will have the same behavior as
the wrapped(original) object. However now the returned objects
will have an extra property 'request_ids' which is a list of
exactly one request id.

For generator cases the request_ids property will be an empty list
until the underlying generator is invoked at-least once.

Co-Authored-By: Abhishek Kekane <abhishek.kekane@nttdata.com>

Closes-Bug: #1525259
Blueprint: return-request-id-to-caller
Change-Id: If8c0e0843270ff718a37ca2697afeb8da22aa3b1
2017-01-20 14:50:42 +05:30
Evgeny Antyshev 6ab6a740ff Add ploop in disk_format
"ploop" image format is supported in upstream Glance
https://review.openstack.org/341633

And similar patch has been added in python-openstackclient:
https://review.openstack.org/411405

Co-Authored-By: yuyafei <yu.yafei@zte.com.cn>
Change-Id: I1471224df97cf5fecfe7f02e549855af81c45848
Related-Bug: 1650342
2017-01-19 14:31:01 +00:00
OpenStack Proposal Bot 54e6faadf2 Updated from global requirements
Change-Id: I63545eb6cb26b6296e162c39c8df93d35ea652d0
2017-01-16 17:27:24 +00:00
Jenkins 8f8df1cced Merge "Handle formatting of subcommand name in error output" 2017-01-13 19:35:35 +00:00
Ian Cordasco 81039a1e36 Handle formatting of subcommand name in error output
On Python 2, decoding all arguments leads to the possibility that users
that use the wrong command or mistype the name will see error output
with a unicode string's representation instead of one without it. To
avoid this we try and find the first non-option string in the argument
list and replace it with an string that is not text only on Python 2. If
we encoded the string at all times, then users installing glanceclient
on Python 3 would see b'invalid-subcommand' instead. That's as bad as
seeing u'invalid-subcommand' on Python 2.

Closes-bug: 1533090
Change-Id: I018769e159a607ebb233902cbeb13b95ca417190
2017-01-11 07:33:34 -06:00
Li Wei efb5e2aa32 Add vhdx in disk_format
vhdx is also a format of the disk valid value in v2 version,
so add it in disk_format.

Related-Bug: 1635518
Co-Authored-By: Stuart McLaren <stuart.mclaren@hpe.com>
Change-Id: I7d82d4a4bdb180a53e86552f6f6b3bed908e6dc0
2017-01-10 07:41:02 +00:00
Luong Anh Tuan 1a5fac7da2 Replace dict.iteritems() with dict.items()
Following Python 3 guide https://wiki.openstack.org/wiki/Python3
Thus, we should replace task.iteritems() with task.items()

Change-Id: If617c3a87836930dc78a4ce7dd45a9b7804e0d24
2016-12-20 11:02:42 +07:00
Jenkins fa11427af5 Merge "Use import_versioned_module from oslo.utils" 2016-12-16 12:30:19 +00:00
OpenStack Proposal Bot 07e0cb9e2b Updated from global requirements
Change-Id: If643570d0aebd47f7c9d76285a30dc26aaa1425f
2016-12-15 03:54:52 +00:00
Jenkins 8b96bbc34c Merge "Revert "Add last_request_id member to HTTPClient and SessionClient"" 2016-12-14 17:35:22 +00:00
Li Wei 4773c96672 Use import_versioned_module from oslo.utils
oslo.utils 3.17 provides this funtion, so just use it directly.

Change-Id: I85cb78a6fd33a5b1f7e09648efed1b0737678eee
Closes-Bug: #1627313
2016-12-06 09:35:55 +00:00