summaryrefslogtreecommitdiff
path: root/glanceclient
Commit message (Collapse)AuthorAgeFilesLines
* Downloading image with --progress failsAbhishek Kekane2017-06-072-1/+13
| | | | | | | | | | | | | | | | | | | 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] 610177a779b95f931356c1e90b05a5bffd2616b3 Closes-Bug: #1670464 Change-Id: I188e67c2487b7e4178ea246f02154bbcbc35a2b1 (cherry picked from commit 60c06d526c228de314ad659bda57c42750852ef9)
* Downloading image with --progress fails for python3Abhishek Kekane2017-06-072-2/+7
| | | | | | | | | | | | | 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 (cherry picked from commit bb2a5e946f36fc28ffa138357d644c2b7ec52242)
* Merge "Add support for community images"Jenkins2017-01-233-3/+21
|\
| * Add support for community imagesAlexander Bashmakov2016-11-103-3/+21
| | | | | | | | | | | | | | | | This patch adds support for community images retrieval and creation in the Glance client. Depends-On: I94bc7708b291ce37319539e27b3e88c9a17e1a9f Change-Id: I81e83eab5a9d30643c354f0cb6df425cf7a7bae3
* | Merge "Add request id to returned objects"Jenkins2017-01-2318-211/+567
|\ \
| * | Add request id to returned objectsRavi Jethani2017-01-2018-211/+567
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add ploop in disk_formatEvgeny Antyshev2017-01-194-4/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | "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
* | Merge "Handle formatting of subcommand name in error output"Jenkins2017-01-132-1/+64
|\ \
| * | Handle formatting of subcommand name in error outputIan Cordasco2017-01-112-1/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add vhdx in disk_formatLi Wei2017-01-104-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Use import_versioned_module from oslo.utils"Jenkins2016-12-163-10/+6
|\ \ \
| * | | Use import_versioned_module from oslo.utilsLi Wei2016-12-063-10/+6
| |/ / | | | | | | | | | | | | | | | | | | oslo.utils 3.17 provides this funtion, so just use it directly. Change-Id: I85cb78a6fd33a5b1f7e09648efed1b0737678eee Closes-Bug: #1627313
* | | Merge "Revert "Add last_request_id member to HTTPClient and SessionClient""Jenkins2016-12-142-12/+0
|\ \ \ | |/ / |/| |
| * | Revert "Add last_request_id member to HTTPClient and SessionClient"Abhishek Kekane2016-05-232-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Add Apache 2.0 license to source file"Jenkins2016-11-181-0/+12
|\ \ \
| * | | Add Apache 2.0 license to source fileCao Xuan Hoang2016-10-041-0/+12
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per OpenStack licensing guide lines [1]: [H102 H103] Newly contributed Source Code should be licensed under the Apache 2.0 license. [H104] Files with no code shouldn't contain any license header nor comments, and must be left completely empty. [1] http://docs.openstack.org/developer/hacking/#openstack-licensing Change-Id: I15cbb71d028e9297cb49b5aab7d0427f7be36c49
* | | Move old oslo-incubator code out of openstack/commonAbhishek Kekane2016-11-0813-330/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the first community-wide goal, teams were asked to remove the openstack/common package of their projects if one existed. This was a byproduct of the old oslo-incubator form of syncing common functionality. Package openstack/common/apiclient is moved to glanceclient/v1 package as it is used by v1 api only. NOTE: Removed glanceclient/common/base.py as it is deprecated and not used anywhere. Closes-Bug: #1639487 Change-Id: Ib3ac09743ce761ab0186e99e1c9de02517f89510
* | | Replace 'assertTrue(a not in b)' with 'assertNotIn(a, b)'Cao Xuan Hoang2016-09-281-1/+1
|/ / | | | | | | | | | | trivialfix Change-Id: I4d05a8bbcf99794c02261a9f9136e1c6f2c561a6
* | switch from keystoneclient to keystoneauthItisha Dewan2016-09-035-46/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | move glanceclient to keystoneauth as keystoneclient's auth session, plugins and adapter code has been deprecated. refer to [1] for more information. 1: https://github.com/openstack/python-keystoneclient/commit/1a84e24fa4ce6d3169b59e385f35b2a63f2257f0 implements bp: use-keystoneauth Co-Authored-By: Itisha <ishadewan07@gmail.com> Change-Id: I88fb327628e1bec48dc391f50d66b3deab4a8ab9
* | Merge "Revert "Don't update tags every time""2.5.0Jenkins2016-08-202-34/+6
|\ \
| * | Revert "Don't update tags every time"Steve Martinelli2016-08-192-34/+6
| | | | | | | | | | | | | | | | | | This reverts commit e77322c17931810f4029ef339a791f702f2f4580. Change-Id: Ida826a2aa888beeb76dbe657b2ccd6cb088157ed
* | | Update doc URLKATO Tomoyuki2016-08-191-1/+1
| | | | | | | | | | | | | | | | | | Docs team changed URL for search engine optimization. Change-Id: I68e2a5d666da55722d5ee2fa4aec2326c0de0946
* | | Merge "Fix warlock model creation"2.4.0Jenkins2016-08-125-12/+19
|\ \ \
| * | | Fix warlock model creationSabari Kumar Murugesan2016-07-065-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Don't update tags every time"Jenkins2016-08-082-6/+34
|\ \ \ \ | | |/ / | |/| |
| * | | Don't update tags every timeMike Fedosin2016-06-012-6/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code removes unnecessary PATCH requests for tags updating if they were not modified. Change-Id: I8eced32f39d0c98e0b26014e7b2341ab6580ff01 Closes-bug: 1587999
* | | | Merge "Remove unused openstack/common/apiclient/client"Jenkins2016-08-042-575/+0
|\ \ \ \
| * | | | Remove unused openstack/common/apiclient/clientMatt Riedemann2016-07-272-575/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code comes from oslo-incubator and is now frozen, and the client module specifically is not used in glanceclient. It's confusing to have in the library since glanceclient has it's own HTTPClient under glanceclient.common.http. So let's just remove this effectively dead code. Change-Id: I820b2439ce7158a63dc55553ce50a9580d63ffb3
* | | | | Merge "Fix string interpolation to delayed to be handled by the logging code"Jenkins2016-07-301-1/+1
|\ \ \ \ \
| * | | | | Fix string interpolation to delayed to be handled by the logging codehaobing12016-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String interpolation should be delayed to be handled by the logging code, rather than being done at the point of the logging call. See the oslo i18n guideline. * http://docs.openstack.org/developer/oslo.i18n/guidelines.html Change-Id: If06663076e4081c6268ba88c157513723b734b31 Closes-Bug: #1596829
* | | | | | Merge "Log request-id before exceptions raised"Jenkins2016-07-301-10/+10
|\ \ \ \ \ \
| * | | | | | Log request-id before exceptions raisedAbhishek Kekane2016-07-181-10/+10
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of now request-id is not logged if an excpetion is raised. Rearranged code so that request-id is logged even in case of an exception. Change-Id: Iee0398404ee752c0d880edf3054207c35862e71a Closes-Bug: #1603863
* | | | | | Merge "py3: Fix encoding and use sys.stdin.buffer"Jenkins2016-07-286-5/+28
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | py3: Fix encoding and use sys.stdin.bufferSirushti Murugesan2016-07-256-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * exc.py: Encode body in response before calling replace over it. * http.py: prepend the bytes literal to the empty string or else we hit bug 1342080 again in python 3. * utils.py: Use sys.stdin.buffer in python 3. Change-Id: Ieefb8c633658e507486438e5518c5d53e819027d
* | | | | | Replace OpenStack LLC with OpenStack Foundationdineshbhor2016-07-261-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | Change-Id: I5877db07031b12d8fa7ed774ac09d24f8906ea86 Closes-Bug: #1214176
* | | | | Merge "Add comment about workaround for py3"Jenkins2016-07-201-0/+2
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Add comment about workaround for py3Louis Taylor2016-07-131-0/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: Ibe8720c14e8ec401bc0d595915cbb962f4021bcb
* | | | | Merge "Update outdated image shema"Jenkins2016-07-161-91/+63
|\ \ \ \ \
| * | | | | Update outdated image shemaMike Fedosin2016-06-281-91/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge "Log request-id for each api call"Jenkins2016-07-151-0/+10
|\ \ \ \ \ \
| * | | | | | Log request-id for each api callAbhishek Kekane2016-06-271-0/+10
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge "Update docs URL"Jenkins2016-07-142-3/+3
|\ \ \ \ \ \
| * | | | | | Update docs URLKATO Tomoyuki2016-07-132-3/+3
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | Change-Id: Id8b1b97a85534c4398b3c49648c6e2f2df3ee20e Related:-Bug: #1602266
* | | | | | Merge "image-download: tests to catch stray output"Jenkins2016-07-134-4/+188
|\ \ \ \ \ \ | |/ / / / / |/| | / / / | | |/ / / | |/| | |
| * | | | image-download: tests to catch stray outputStuart McLaren2016-06-294-4/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge "Replace tempest_lib with tempest.lib"Jenkins2016-06-292-2/+2
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Replace tempest_lib with tempest.libwangxiyuan2016-06-272-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Use correct order of arguments to assertEqual"Jenkins2016-06-295-39/+35
|\ \ \ \ | |/ / / |/| | |
| * | | Use correct order of arguments to assertEqualzhengyao12016-06-295-39/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Remove unused skip_authentication decorator"Jenkins2016-06-212-18/+1
|\ \ \ \ | |/ / / |/| | |