Commit Graph

39 Commits

Author SHA1 Message Date
Jenkins a7c33d5802 Merge "change assertEquals to assertEqual" 2013-11-15 06:33:29 +00:00
Jenkins 9a649d46ea Merge "Replace OpenStack LLC with OpenStack Foundation" 2013-11-15 06:33:28 +00:00
Christian Berendt 7f8292f39d change assertEquals to assertEqual
According to http://docs.python.org/2/library/unittest.html
assertEquals is a deprecated alias of assertEqual.

Change-Id: I22f4702f41537c05684dfacb3f305627b36849c5
2013-10-24 07:54:16 +02:00
eddie-sheffield 32d9c42816 Add CLI for V2 image create, update, and upload
Provides command line support for image-create, image-update,
and image-upload using the Glance V2 API. This includes building
help text for create and update based on the image jsonschema
as fetched from the server.

Also fixes bug caused by default warlock patch generation not
matching what Glance expects when updating a core property
which had not originally been set when the image was created.

Related to bp glance-client-v2

Change-Id: I841f9e3d05802f4b794cb6f4849abe03ff0324d9
2013-10-02 13:22:55 -04:00
ZhiQiang Fan 2517203975 Replace OpenStack LLC with OpenStack Foundation
Change-Id: I38dcbcf1a6c8efe540fcf5f29e782cb3826e583d
Fixes-Bug: #1214176
2013-09-20 04:05:51 +08:00
Jenkins 360a29a763 Merge "Use openstack-images-v2.1-json-patch for update method" 2013-09-19 17:55:45 +00:00
Fei Long Wang 897ae3d795 Enable query image by tag
This patch will enable Glance client to query images by user
defined tags.

Implement bp image-query-by-tag
Implement bp glance-client-v2

Change-Id: I6f54630c5b7c9c567d85485ad4289284e5486814
2013-08-28 14:13:27 +08:00
Ghe Rivero 3307549a0f Use openstack-images-v2.1-json-patch for update method
image.patch returns a JSON schema Draft 10 (application/openstack-images-v2.1-json-patch)
while the glaceclient update method specify a Content-Type header
application/openstack-images-v2.0-json-patch with correspond to a JSON schemea Draft 4.

Fixes bug 1206095
Change-Id: I8c5a96f0e117a81b5b527a96ef45758fc69b518d
2013-08-23 06:52:08 +00:00
eddie-sheffield 7e4ba229c3 \Allow removal of properties using glance v2 api
This adds support to the glance client library for removing
properties from an image. Properties to be removed must be
explicitly listed. There is no equivalent of the 'purge_props'
functionality in v1.

Also beefed up testing around create since some of the
functionality is the same as update.

Fixes bug 1206472

Change-Id: I16f4c39cdfc8a0cd07bede600461b7a289fbb080
2013-08-13 14:13:27 -04:00
mouad benchchaoui 1d7da740b2 Show a pretty progressbar when uploading and downloading an image.
Add a new module that contain generic wrapper for file and iterator, which
are used to wrap image to upload and the request body iterator in upload and
download cases repectively, to show and advance a pretty progress bar when this
laters are consumed, The progress bar is triggered by adding a --progress command
line argument to commands: image-create, image-download or image-update.

Change-Id: I2ba42fd0c58f4fa087adb568ec3f08246cae3759
bug fix: LP#1112309
blueprint: progressbar-when-uploading
2013-08-08 15:40:15 +02:00
Jenkins 43e71e3993 Merge "Changes to allow image upload with V2 api" 2013-07-31 19:10:12 +00:00
eddie-sheffield e827c37a05 Changes to allow image upload with V2 api
Related to bp glance-client-v2

Change-Id: I72a1d2825dd5c1ff4890e8be477cb4447d59f136
2013-07-31 12:28:24 -04:00
Jenkins 5c4fb2f7a1 Merge "Fix test assertions & test cases for V2 Shell Unit test" 2013-07-31 15:22:04 +00:00
eddie-sheffield 92e4ee201a Enable client library V2 to create an image.
Adds support for creating an image to the client library only, not the CLI.
Replaced reference to deprecated BaseException.message

Related to bp glance-client-v2

Change-Id: I8e3d09d89493368d22f7b1f69f79ebd2518e289d
2013-07-25 14:45:00 -04:00
Venkatesh Sampath 060a3fe2c0 Fix test assertions & test cases for V2 Shell Unit test
Fixes bug 1195674

Change-Id: I46c10040ea10415498dd1eed69e45139cfa37eb4
2013-07-25 08:11:58 +05:30
Jenkins eb6ed51647 Merge "Expose checksum index image property in client" 2013-07-17 19:00:48 +00:00
amalaba 09b29aac12 Expose checksum index image property in client
Implement checksum image index property in the python-glanceclient

Change-Id: If1426b7938457014ef27a86d3902d53854161627
Implements: blueprint index-using-checksum-image-property
2013-07-12 15:05:26 +05:30
Jenkins 8427208015 Merge "Rename invalid domain name to be RFC compliant." 2013-07-08 16:16:21 +00:00
Venkatesh Sampath b9c1df8dfc Enable client V2 to update/delete tags for a given image.
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
2013-07-02 21:32:49 +05:30
Monty Taylor bd0880cc94 Rename invalid domain name to be RFC compliant.
http://tools.ietf.org/html/rfc6761 and
http://tools.ietf.org/html/rfc2606 define invalid domain names to
be used in contexts such as this. It's good to be compliant with RFCs.

Change-Id: Ibb7f9ee12c0c4331f8a33470def74c3a136ef6d9
2013-06-30 23:33:07 -04:00
Dirk Mueller 62579fbb21 Start using Pyflakes and Hacking
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
2013-06-22 16:00:26 +02:00
Flaper Fesp 81e88344fb Add tests for encodings
The patch adds tests for headers encodings, incoming data decoding,
outgoing meta encoding and filters encoding.

Fixes bug: #1187013

Change-Id: I7e59bf6c44b9d188bd3faf32fc09f309f3ad67d3
2013-06-03 17:40:50 +02:00
Tatyana Leontovich 8451a94822 Add test for glanceclient shells
Add unittests for the following modules:
* glanceclient.shell
* glanceclient.v1.shell
* glanceclient.v1.legacy_shell
* glanceclient.v2.shell
Also add mock library to the tools/test-requires

Implements: blueprint glanceclient-shells-unittests
Change-Id: I5ec527c5efff3726932d234d7c67e08149643f89
2013-05-17 19:46:07 +03:00
iccha-sethi 18795f590a Image Members for glance v2 api
Lists, creates, deletes, updates image members using glance
v2 api.

Related to bp glance-api-v2-image-members

Change-Id: Ic018a265a1676bb0a5638a55e70a527ce6b447fc
2013-05-09 10:54:12 +00:00
Dirk Mueller 45feb672af Improve Python 3.x compatibility
Some mechanical translation of the deprecated
except x,y construct. Should work with Python >= 2.6
just fine

Change-Id: I394f9956b9e3e3d9f5f1e9ad50c35b13200af2a1
2013-04-22 16:38:55 +02:00
Brian Rosmaita 552a68d2bf Implements filters: visibility, owner, member_status.
Includes tests.

Related to bp glance-api-v2-image-members

Change-Id: Ic48f54639fec4dc9b48819a8ffb1f0097001894c
2013-03-08 14:01:34 +00:00
Brian Waldon 00ba17965a Add library support for v2 image update
Related to bp glance-client-v2

Change-Id: Ia6fe16e462ce8827175577cbed8e15c326bf8ad3
2013-02-13 10:06:25 -08:00
Anita Kuno a6ef8ed7da Adds image-delete functionality.
Change-Id: Ic10433f6eb484a4760f3e61f040e903e86b95d91
2013-01-29 15:39:46 +00:00
Monty Taylor 1d461a6496 Use testtools instead of unittest.
Part of blueprint grizzly-testtools

Change-Id: Ie914fd8f59cddb1a480566ec4eff908bfb51921c
2013-01-02 15:20:36 -08:00
Chuck Short c0ec97f310 Pin pep8 to 1.3.3
Standardize pep8 to 1.3.3 and cleared up any errors
found by pep8 tests.

Change-Id: Ib7eb97d0789556d1676ccad58b5d3364065b7d15
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2012-11-25 11:34:56 -05:00
Lars Gellrich 137b3cf975 Enable client V2 to download images
Added the CLI option image-download to download an image via API V2.
Added utility function to save an image.
Added common iterator to validate the checksum.

Related to bp glance-client-v2

Change-Id: I0247f5a3462142dc5e9f3dc16cbe00c8e3d42f42
2012-08-09 17:14:22 +00:00
Brian Waldon c24ea3f848 Stop looking for v2 image in container
The v2 API no longer returns images in JSON containers like
'{"image": {...}}', so stop trying to decode the responses
as if it does.

Fix bug 1031185

Change-Id: I5209fe76445d4195b12944146a0ef190883f363f
2012-07-30 20:54:23 -07:00
Brian Waldon 0f628b19cb Add pagination to v1 image-list
* Use recursive generator function to make subsequent requests
  to the v1 detailed images resource
* 'limit' continues to act as the absolute limit of images to return
  from a list call
* 'page_size' indicates how many images to ask for in each subsequent
  pagination request
* Expose --page-size through the cli
* Convert v1 images tests to use strict url comparison
* Drop strict_url_check from FakeAPI kwargs - now the functionality
  is always active and tests must directly match fixture urls
* Fix bug 1024614

Change-Id: Ifa7874d88360e03b5c8aa95bfb9d5e6dc6dc927e
2012-07-19 13:26:37 -07:00
Brian Waldon d88d8fc462 Add pagination to v2 image-list
* Use a recursive generator function to iterate over the image
  container. The presence of next links are indicators to
  continue pagination while their value drives the location of
  the next page.
* A user can pass in --page-size on the command line, or page_size
  when using the controller directly, to control how many images
  are requested with each subsequent paginated request. Default page
  size is 20.
* Add a flag (strict_url_check) for the FakeAPI class to control
  whether it chops off query params when trying to match a request
  to a fixture.
* Related to bp glance-client-v2.

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a12
2012-07-13 20:12:06 -07:00
Brian Waldon e5f038b62a Convert v2 images list method to generator
We will want this to be a generator as soon as we implement
pagination. Let's establish the interface now.

Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a07
2012-07-13 18:38:41 -07:00
Brian Waldon c398af18b0 Replace static v2 Image model with warlock model
* Add warlock v0.1.0 as a dependency
* Generate a pythonic, self-validating Image model using warlock
* Add raw method to Schema model
* Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a04
2012-07-13 18:38:41 -07:00
Brian Waldon b6cef9d145 Add support for viewing a single image through v2
* Add image-create command
* Add tests for Image model, Controller.get, and Controller.list
* Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a06
2012-07-13 18:38:40 -07:00
Brian Waldon f0445a1b44 Rewrite link parsing for finding v2 schemas
What we called 'links' are no longer returned in a container of
objects, they are top-level entity attribtues. This fixes the
parsing of the entities to look in the correct place when trying
to locate a specific schema.

Add a helper for printing to stderr and exiting with a non-zero
exit code.

Map 'name' to 'Attribute' when explaining a schema.

Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a05
2012-07-13 18:38:40 -07:00
Brian Waldon 7f48506781 Add 'explain' command to v2 that describes schemas
At its core, this is adding the ability to finx a schema through
published links and convert it to a usable object.

Related to bp glance-client-v2

Change-Id: I7b38ad091c6b0ad80197eb789503cf73989893e5
2012-06-07 14:43:00 -07:00