Commit Graph

714 Commits

Author SHA1 Message Date
Jenkins 9fac2a557e Merge "Create functional test base" 2015-04-28 22:51:23 +00:00
Jenkins d4d7fdc354 Merge "Move unit tests to standard directory" 2015-04-28 16:33:58 +00:00
Doug Hellmann 6d3111614d Update README to work with release tools
The README file needs to have links to the project documentation and bug
tracker in a parsable format in order for some of the release tools
scripts to work (particularly the one that prints the release note
email).

Change-Id: I37e0acc5ed8e1af565359290fa622456901c735e
2015-04-21 15:21:16 +00:00
Stuart McLaren 71d97836f8 Create functional test base
This will allow adding 'check-glanceclient-dsvm-functional' tests in
the gate, similar to:

 * check-novaclient-dsvm-functional
 * check-keystoneclient-dsvm-functional
 * check-neutronclient-dsvm-functional
 * etc

Change-Id: Id970db52695db7dc53206aa05fe573995b57aa78
2015-04-18 17:43:01 +00:00
Stuart McLaren f2a8a520e7 Move unit tests to standard directory
This patch moves the glanceclient unit tests to the standard directory
(xxxclient/tests/unit) in preparation for adding functional gate tests
'check-glanceclient-dsvm-functional' in the same vein as existing client
tests for other projects, eg:

* check-novaclient-dsvm-functional
* check-keystoneclient-dsvm-functional
* check-neutronclient-dsvm-functional

Change-Id: I29d4b9e3a428c851575ee9afde40d6df583456c4
2015-04-18 17:42:20 +00:00
Jenkins 825c4a5df2 Merge "Correct help messages for image-update command" 2015-04-18 10:00:59 +00:00
Doug Hellmann 8b4456a220 Uncap library requirements for liberty
Change-Id: I5760af63dba65fadb21065d822e1f9c1865c328a
Depends-On: Ib948b756b8e6ca47a4c9c44c48031e54b7386a06
2015-04-16 18:13:00 +00:00
Jenkins dfcce08710 Merge "Omit 'locations' as image-create parameter" 2015-04-15 20:49:12 +00:00
Jenkins 9184429830 Merge "Fix https stack trace on python 3.4 client" 2015-04-15 11:07:38 +00:00
Jenkins 6a2e9f3602 Merge "Fix client when using no ssl compression" 2015-04-15 11:05:20 +00:00
Jenkins 4753ee34ee Merge "Add unit tests for log_curl_request" 2015-04-15 05:31:19 +00:00
Jenkins b9338ce2da Merge "Add SSL cert verification regression tests" 2015-04-14 16:19:25 +00:00
Michal Dulko 76c9f68ab6 Add unit tests for log_curl_request
Add 5 new tests that check if log_curl_request method produces proper
curl commands and add again an old test checking this method for
unicode support.

Change-Id: I64caad18d537d727835f3a7ada010ec45b20638a
Closes-Bug: 1174339
2015-04-14 10:00:51 +02:00
Jenkins 549761c6b8 Merge "Test unit for checking update active images" 2015-04-13 00:07:28 +00:00
Stuart McLaren bd0aa0672e Fix https stack trace on python 3.4 client
When using the client with python 3.4 and no ssl compression the following
stack trace ocurrs:

 TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Closes-bug: 1442883
Related-bug: 1357430
Change-Id: I8e28f0bb1f3e866f11851247ce31470ca8c2af4f
2015-04-11 11:04:23 +00:00
Stuart McLaren c698b4e322 Fix client when using no ssl compression
Since the release of the 0.16.1 client, using the 'no ssl compression'
option, whether on the command line, or via the library -- Nova does this by
default -- a stack trace was generated.

Closes-bug: 1442664
Related-bug: 1357430

Change-Id: I2b8ddcb0a7ae3cfccdfc20d3ba476f3b4f4ec32d
2015-04-11 11:03:54 +00:00
Stuart McLaren 64a1a0fdcc Add SSL cert verification regression tests
A security bug (1357430) was introduced which meant that SSL certificate
verification was not occurring.

Add new tests which help prevent the 'requests' part of bug 115260
recurring.

Change-Id: Iaf56fd8bc34fa8f35c2fd7051f9f8424002352cf
Related-bug: 1357430
2015-04-11 11:00:19 +00:00
Fei Long Wang c73026634c Omit 'locations' as image-create parameter
Based on current implementation, locations is reserved
attribute, so it should not be a parameter for image
create.

Closes-Bug: #1399778

Change-Id: Ie51e52157e905fdecf736125be0dac87b1a966ec
2015-04-11 00:02:22 +12:00
Jenkins 287bf62261 Merge "Validate tag name when filtering for images" 2015-04-09 13:10:10 +00:00
Jenkins 93569c61de Merge "glance image-show now have --human-readable option" 2015-04-08 13:26:09 +00:00
Jenkins 5b4aef5742 Merge "Creating task with invalid property crashes in py3" 2015-04-07 13:30:04 +00:00
Jenkins c634c5149c Merge "Expose 'is_base' schema property attribute" 2015-04-02 15:38:24 +00:00
Kamil Rykowski a6234d1c4e Creating task with invalid property crashes in py3
Currently when you are trying to set invalid additional property for
task using py3 interpreter it will fail, because function `unicode` does
not exist in py3.

Fix it by replacing `unicode` with `utils.exception_to_str` which is
used in other modules already.

Change-Id: I5897868f801467a2eaa7585b5f2d578cef358426
Closes-Bug: 1439513
2015-04-02 06:15:48 +00:00
Jamie Lennox fd2f989cca Don't accept *args for client
The HTTPClient object that we are passing *args to does not accept any
args. Don't accept them from the main client interface.

Change-Id: I473bb64be95e058375ebd1e55d4bda4168c3c430
2015-03-28 14:22:49 +11:00
Jamie Lennox e386e441af Stub authentication requests rather than plugins
Rather than testing that a certain plugin was loaded test to make sure
that the client actually did the authentication request and that the
content of that request was correct.

This means we are not so tightly bound to those specific plugins and
this can be changed in later reviews.

Change-Id: Ia3ae0069e3e0277d655f0e251196eca658f94c75
2015-03-28 14:21:51 +11:00
Jamie Lennox 27f70bbd58 Remove keystoneclient mocks
The majority of the mocks on keystoneclient are not needed. Instead we
use the fixtures that keystoneclient provides to create well formed
responses and use requests_mock to stub out those values when accessed.

This is a closer to real usage pattern and the way that most client
projects are now handling keystoneclient auth.

Change-Id: I294aca1d11c9c5cfb4b82ad16476af4000efee1c
2015-03-28 14:19:52 +11:00
Jamie Lennox 02b1a05226 Replace mox in tests with requests-mock
requests-mock is a tool specifically designed for mocking responses from
the requests library. Use that instead of handling mox and mock
ourselves.

Change-Id: Ifd855b8d6c1b401e29ac210593c48d2da87a571b
2015-03-28 14:16:00 +11:00
Jenkins b3d2c636ec Merge "Use any instead of False in generator" 2015-03-27 23:56:39 +00:00
Alexander Tivelkov 90407d9e47 Expose 'is_base' schema property attribute
Changeset I49255255 has added an 'is_base' attribute for Image Schema
properties, thus allowing to differentiate between base and custom image
properties, but the client hasn't make any use of it.

This patch adds appropriate attribute to SchemaProperty class and a
helper method which allows to validate if the given property is base or
not.

The added helper method (is_base_property) should not be confused with
the existing is_core_property: the latter just checks if the property is
known to the schema, regardless of its being base or not.

Change-Id: I7c397196dad9ae5494ed2f8f3aacef3fc1ce70d8
Partial-Bug: #1323660
2015-03-27 19:03:48 +03:00
Kamil Rykowski 2c08b40bf0 Validate tag name when filtering for images
Right now all invalid tags are skipped when filtering for image list. We
should change this behaviour to raise an exception when invalid tag
value is provided.

Additionally remove misplaced `pass` from one of the tests.

Closes-Bug: 1433962
Change-Id: If5148608a70ee019697ea2dcb84e19a53222d596
2015-03-26 12:42:36 +00:00
Kamil Rykowski 13b5a5ade1 Remove redundant FakeSchemaAPI __init__ method
Currently, the FakeSchemaAPI in tests/utils has an overriden __init__
method which simply calls super of FakeAPI and doesn't perform any extra
operations. This is redundant, because same effect will be achieved when
__init__ definition is omitted in FakeSchemaAPI. Additionally it uses
'cls' as first param instead of 'self' which breaks naming convention.

Change-Id: I3e72adfbc7b67076748f640d74507ff28c6060d7
Closes-Bug: 1418508
2015-03-26 12:42:18 +00:00
Jenkins 15c2e40449 Merge "Generate API documentation" 2015-03-25 05:17:08 +00:00
yatin karel c149a94ee1 glance image-show now have --human-readable option
Added option '--human-readable' to image-show cli which allows users
to display image size in human-readable format.

Change-Id: Ic3452ce4560d3cf90fa7f59f98e5ff42e804f8c9
Closes-Bug: #1434381
2015-03-22 17:26:55 +05:30
Victor Morales 42d7548257 Test unit for checking update active images
This test unit pretends to cover attempts to upload images with active
status.

Change-Id: Id557157b30d78af474973a9d385c34aeb8afd0c3
Closes-Bug: #1434306
2015-03-19 20:53:54 -06:00
Abhishek Talwar 6d864ef65c Correct help messages for image-update command
Currently when you are trying to update the location of an image which
is not in queued status you will get an error from the Glance API. The
help message for --location and --copy-from arguments should be updated
to inform the user that it works only for images in queued status.

Co-Authored-By: Abhishek Talwar <abhishek.talwar@tcs.com>
Co-Authored-By: Kamil Rykowski <kamil.rykowski@intel.com>

Change-Id: I82b14ffde3f301d7ffef68e984ba4ad2ae0f8b0f
Closes-Bug: #1220809
2015-03-19 10:24:34 +01:00
Nikhil Komawar 26280ed58b Add release notes for 0.17.0
$ git log 0.16.1..HEAD --no-merges --oneline

db5d729 Updated help for v2 member-update api
3f3066b Extend images CLI v2 with new sorting syntax
bbd27d5 Add the ability to specify the sort dir for each key
976fe17 Import sys module
fc79467 Adds the ability to sort images with multiple keys
f00f769 add examples for properties and doc build script
f6f5733 Apply expected patch format when updating tags in v2.images
a9a692b v2: read limit for list from --limit in shell
0ab5a78 Fix leaking sockets after v2 list operation
f98ab68 Fix leaking sockets after v1 list operation
6e0b1f4 removed excessive call to os.path.exists
b47925e Unit tests covering missing username or password
b64dba8 Remove duplicate 'a' in the help string of --os-image-url
6d21959 v2: Allow upload from stdin on image-create
4c7c7ad Fix v2 image create --file documentation
eeef763 Fix minor typo in version error message

Change-Id: I90d7e4a5109d82e25a63135e94193f4c4f7d4f34
2015-03-18 16:23:01 -04:00
Jenkins 3a69231f4f Merge "Updated help for v2 member-update api" 2015-03-18 19:32:42 +00:00
Jenkins 1c4d9f7ada Merge "add examples for properties and doc build script" 2015-03-18 12:11:46 +00:00
Yamini Sardana db5d72947c Updated help for v2 member-update api
help message for v2 glance member-update api
now displays the Valid Values of member status
variable.

The valid values are: pending, accepted, rejected

Change-Id: Ibe6f55c933668451b407ed9a19c520c3fbf1912a
Closes-bug: #1420707
2015-03-17 11:45:43 +05:30
Jenkins 6db625f287 Merge "Extend images CLI v2 with new sorting syntax" 2015-03-16 20:12:42 +00:00
Jenkins 82143e26d3 Merge "Add the ability to specify the sort dir for each key" 2015-03-16 20:11:50 +00:00
Jenkins c32a41415d Merge "Adds the ability to sort images with multiple keys" 2015-03-16 20:11:34 +00:00
Mike Fedosin 3f3066be97 Extend images CLI v2 with new sorting syntax
This code enables new syntax for sorting output with multiple
keys and directions based on API Working group sorting
guidelines.

It's a client code to consume API modified in change
Ie4ccfefa0492a3ac94cc7e22201f2f2be5c1cdbb

Example:
glance --os-image-api-version 2 --sort name:desc,size:asc

Implements-blueprint: glance-sorting-enhancements
DocImpact
Depends-On: Ie4ccfefa0492a3ac94cc7e22201f2f2be5c1cdbb
Change-Id: I36a9fa9f0508fea1235de2ac3a0d6a093e1af635
2015-03-16 19:31:49 +03:00
Jenkins 7c54b14cf0 Merge "Apply expected patch format when updating tags in v2.images" 2015-03-16 16:24:16 +00:00
Mike Fedosin bbd27d5276 Add the ability to specify the sort dir for each key
Adds client code to consume API modified in change
Ib43b53abfba7cb5789d916a014376cf38fc5245b

Extends CLI for v2 with multiple sort dirs
Example:
glance --os-image-api-version 2 image-list \
--sort-key name --sort-dir asc --sort-key size --sort-dir desc

Implements-blueprint: glance-sorting-enhancements
DocImpact
Depends-On: Ib43b53abfba7cb5789d916a014376cf38fc5245b
Change-Id: Ia20716f3c75299f796879299da317b2e81496088
2015-03-16 14:29:06 +03:00
Jimmy McCrory 976fe1776b Import sys module
This module is required by the _is_image_data_provided function.

Change-Id: I78265209a2f80aaf61bbe25d69e79c939182516c
Closes-Bug: 1432249
2015-03-14 14:32:40 -07:00
Mike Fedosin fc79467ff6 Adds the ability to sort images with multiple keys
Adds client code to consume API modified in change
Ib7a6aeb2df3bc5d23fe8e070290b5bfcab00c0f5

Extends CLI for v2 with multiple sort keys
Example:
glance --os-image-api-version 2 image-list --sort-key name --sort-key size

Implements-blueprint: glance-sorting-enhancements
Change-Id: If79779a4c52c8dc5c4f39192d3d247335a76ba24
DocImpact
Closes-Bug: 1221274
2015-03-13 18:35:00 +03:00
Alan Meadows f00f769da5 add examples for properties and doc build script
* add image property examples for v1 and v2
* add standard sphinx doc build helper

Change-Id: I2f8dff884d9f22cc582aabcbbbbaea6d6fe725c0
2015-03-13 07:01:55 -07:00
Steve Lewis f6f573316c Apply expected patch format when updating tags in v2.images
Currently, glanceclient.v2.update builds a patch request that does not
match glance API.

This patch overrides the default behaviour to customize the patch
request with the right format for the API.

Co-Authored-By: Steve Lewis <steve.lewis@rackspace.com>
Fixes bug 1306774
Change-Id: If0739ac285da1e741bfa40b6c719331a5ce49319
2015-03-12 15:18:20 -07:00
Jenkins cc4c402f09 Merge "Fix leaking sockets after v1 list operation" 2015-03-11 15:02:22 +00:00