Commit Graph

252 Commits

Author SHA1 Message Date
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
Jenkins 11c2c40d46 Merge "Fix "glance add" parsing of "copy_from" option." 2013-04-22 00:05:29 +00:00
Jakub Ruzicka c98432a6d4 Fix "glance add" parsing of "copy_from" option.
copy_from was ignored which resulted in "glance add" attempting to read from
stdout.

Fixes bug 1167899

Change-Id: I57fd85f7bb655bef69222d4fdf6b8274088ca827
2013-04-11 14:43:19 +02:00
Davanum Srinivas b0ce15be3e Fix problem running glance --version
__version__ should point to a string and not VersionInfo

Fixes LP# 1164760

Change-Id: I27d366af5ed89d0931ef46eb1507e6ba0eec0b6e
2013-04-05 09:48:25 -04:00
Tatyana Leontovich 0995045f2a Improve unit tests for python-glanceclient.glanceclient.common.http
Add several tests for glanceclient.common.http module

Fixes: bug #1149445
Change-Id: I6a47c64e11cefea276163777dcd559316fc8e0ad
2013-04-04 15:06:57 +03:00
Brian Waldon 741c15f963 Add docs for 0.9.0
Change-Id: Ic4645b8d83eec6577b67cc17d805c6b12b1bacda
2013-04-02 14:49:59 -07:00
Jenkins 6a8a66120c Merge "Filter images list by public=True|False" 2013-04-02 16:11:27 +00:00
John Bresnahan a8f7de2afd Filter images list by public=True|False
When running the image-list command the user should have the option
to list images according to whether or not the image is was set
to public.  A new test is included to verify this behavior.

Change-Id: If645e7390fcf850648cda780a04ea37a26d855a2
Fixes bug: 1118799
2013-03-30 21:26:35 -10:00
Jenkins 16208485bb Merge "Allow for prettytable 0.7.x as well" 2013-03-21 22:48:35 +00:00
John Bresnahan edf9ae5097 Trapping KeyboardInterrupt sooner.
Currently a KeyboardInterrupt can be triggered by the user while the
client is communicating with keystone.  This patch moves the trap
higher up in the stack.

Fixes bug: 1157905

Change-Id: I16889c2d97bc4694ab27c863c62c27333e264b60
2013-03-20 08:51:59 -10:00
Dirk Mueller 31960f0a85 Allow for prettytable 0.7.x as well
Relax requirements to >= 0.6, < 0.8, as 0.7.x seems to
work as well. Added testcase to ensure this.

Change-Id: I1a1a709e6053451b1256a0d78f8fe8562fb10e62
2013-03-15 17:38:04 +01:00
Jenkins c7c8e92e3c Merge "Implements filters: visibility, owner, member_status. Includes tests." 2013-03-12 14:43:23 +00:00
Jenkins 8787c82f11 Merge "Control C does not cancel the CLI cleanly" 2013-03-11 21:54:47 +00: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
James Li d810019d0e Add missing spaces in help msg
Change-Id: Ida1dcd9c75d1c36ea1b4bfefcd1d1292b565ab6b
2013-03-06 23:42:50 +00:00
John Bresnahan 1a3d40ccb4 Control C does not cancel the CLI cleanly
When a user attempts to terminate the CLI with CTL+C a stack
trace is printed to the screen.  When downloading files the
partial amount downloaded will not be cleaned up.  In most
cases the user redirects to stdout, thus this program cannot
clean that up.

Fixes Bug: 1130390

Change-Id: If9f8ffc72b422d5dbd5969eecde8904238dd8860
2013-03-05 12:12:03 -10:00
Jenkins 0ca43be6fd Merge "Use getattr properly in legacy shell" 2013-02-27 01:26:42 +00:00
Brian Waldon 8ec7468134 Replace SchemaNotFound with HTTPNotFound
Fixes bug 1131682

Change-Id: I615acbef0411677cae5d30262702babd900c0c81
2013-02-22 10:21:00 -08:00
Brian Waldon fbb858aa77 Use getattr properly in legacy shell
Fixes bug 1131703

Change-Id: If97f422af170c29785d2bf8884fafff979031e14
2013-02-22 10:15:50 -08:00
Jenkins 6c7fb0e46c Merge "Report name resolution errors properly" 2013-02-21 22:09:04 +00:00
Brian Waldon 51bbf74264 Add docs for v0.8.0
Change-Id: I86683a88466f96a8bd7e443c436b3bed19f5cfc4
2013-02-21 12:47:53 -08:00
Stanislaw Pitucha 7f7c9a1d85 Report name resolution errors properly
Errors in name resolution have been logged previously with the url path
rather than the hostname. That resulted in incorrect errors like:

InvalidEndpoint: Error finding address for
/v1/images/detail?is_public=none&limit=20: [Errno -2]
Name or service not known

rather than one mentioning hostname itself. This patch changes the log
message to fit the situation.

Change-Id: I1eecbcb22d41b1341c214937b9cbfd046fd301a0
2013-02-19 17:22:55 +00:00
Jenkins d831b5eb27 Merge "Decode input and encode output" 2013-02-18 18:58:14 +00:00
Jenkins 9f1cd2b16b Merge "Update to latest oslo-version." 2013-02-18 03:55:59 +00:00
Jenkins ed644d7228 Merge "Add library support for v2 image update" 2013-02-16 00:17:28 +00:00
Jenkins c994c3ec8b Merge "Expect minumum warlock version of 0.7.0" 2013-02-15 23:48:51 +00:00
Jenkins 541a560f02 Merge "Update .coveragerc" 2013-02-14 01:14:49 +00:00
Flaper Fesp 55cb4f4473 Decode input and encode output
Currently glanceclient doesn't support non-ASCII characters for images
names and properties (names and values as well). This patch introduces 2
functions (utils.py) that will help encoding and decoding strings in a
more "secure" way.

About the ensure_(str|unicode) functions:

    They both try to use first the encoding used in stdin (or python's
    default encoding if that's None) and fallback to utf-8 if those
    encodings fail to decode a given text.

About the changes in glanceclient:

    The major change is that all inputs will be decoded and will kept as
    such inside the client's functions and will then be encoded before
    being printed / sent out the client.

    There are other small changes, all related to encoding to str,
    around in order to avoid fails during some conversions. i.e: quoting
    url encoded parameters.

Fixes bug: 1061150

Change-Id: I5c3ea93a716edfe284d19f6291d4e36028f91eb2
2013-02-13 21:53:11 +01: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
Brian Waldon 96cd98d00b Expect minumum warlock version of 0.7.0
Change-Id: Ic2ef17f29ebd4c157a8ccf7a52b9c74e0c17a54e
2013-02-13 10:05:06 -08:00
Jenkins 882a7f514c Merge "Make effective ssl callback behaviour more obvious" 2013-02-13 02:03:49 +00:00
Monty Taylor d20d9d1ca4 Update to latest oslo-version.
Remove the need for versioninfo file and just use python's PKG-INFO.

Change-Id: I4765141e9bf3fa075dfbbc6a07e495c29e12177b
2013-02-07 05:10:08 -06:00
Alessio Ababilov 2514ec84e5 Update .coveragerc
Set up proper source and omit options.

Change-Id: I2590006f922b2163f9c913d4ce3c349f0e49c68b
Implements: blueprint update-coveragerc
2013-02-06 16:47:06 +02:00
Stuart McLaren 118a0f7a30 Make effective ssl callback behaviour more obvious
When using 'insecure' no callback is executed.

Make it more obvious that the set_verify callback
won't be called by replacing it with a lambda.

Fixes bug 1112361.

Change-Id: Ib5d43a8883f7ed76383971d8154e2111f5ab2869
2013-02-01 15:36:35 +00:00
Vishvananda Ishaya 60cfebc31b Quote image ids before passing them to glance
If the image id contains a space it needs to be quoted or else
it will construct an improper header.

Fixes bug 1111948

Change-Id: I4db2e74401b57de9666d40b38151182b2a76cd1b
2013-01-31 16:21:14 -08:00
David Wittman ed67c32014 Fix typo in image-update help page
The image-update help page reversed the DISK_FORMAT
and CONTAINER_FORMAT metavars.

Fixes bug #1111054

Change-Id: Iec8374782d00e8e9102141fb1e1c16d7f6ac136c
2013-01-30 22:15:19 -06:00
Jenkins 542a45bd28 Merge "Adds image-delete functionality." 2013-01-29 20:03:58 +00:00
Anita Kuno a6ef8ed7da Adds image-delete functionality.
Change-Id: Ic10433f6eb484a4760f3e61f040e903e86b95d91
2013-01-29 15:39:46 +00:00
Jenkins 8df58ff8c2 Merge "Change https port to be an optional parameter" 2013-01-28 23:33:42 +00:00
Jenkins 359759919c Merge "Migrate to testr." 2013-01-25 23:22:43 +00:00
Stuart McLaren 8d0d4b90f3 Change https port to be an optional parameter
VerifiedHTTPSConnection inherits from HTTPSConnection so 'port' should be
an optional argument. If not present it will be set by HTTPSConnection
in the usual way: by parsing the host string (eg 'localhost:8443')
or setting to the default of '443'.

Addresses bug 1102944.

Change-Id: I2c2cb92f824acf15b0ff54590b5614cf206b57e0
2013-01-22 11:44:12 +00:00
Monty Taylor c5e9426bb5 Migrate to testr.
Part of blueprint grizzly-testtools

Change-Id: I9a12f0300e2731a6ee0a82e1f9737a6b83aa5d85
2013-01-16 18:39:18 -05:00
Jenkins a5f996ce9b Merge "Add image names to glance command arguments." 2013-01-09 00:32:11 +00:00
Jenkins 70d8ebb654 Merge "Use testtools instead of unittest." 2013-01-08 04:08:48 +00:00
Ken'ichi Ohmichi 0aba81ac1f Add image names to glance command arguments.
Now a user should specify ID as an image by glance command, and I feel
it is easy-use that a user can specify name also as an image like nova
command(ex. "nova boot").

By applying this patch, a user can specify name as image like the
following examples:

$ glance image-show cirros-0.3.0-x86_64-uec
$ glance image-update --name root-fs cirros-0.3.0-x86_64-uec
$ glance image-delete cirros-0.3.0-x86_64-uec
$ glance image-download cirros-0.3.0-x86_64-uec
$ glance member-create cirros-0.3.0-x86_64-uec 94b0e63a27ca43348fe056622fe3fe94
$ glance member-delete cirros-0.3.0-x86_64-uec 94b0e63a27ca43348fe056622fe3fe94

Fixes bug 1093380

Change-Id: Ia0a070eed6ae3853ef02032f479087edb1d75a67
2013-01-05 07:32:25 +09: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
Ken'ichi Ohmichi 19d542ef5f Add details to stdout error message.
Current glance command does not show the details of error message.
For example, the glance command shows HTTPBadRequest only if some
necessary parameter is not specified.

 $ glance image-create --file root-fs.img --name cirros-0.3.0-x86_64-uec
 Request returned failure status.
 HTTPBadRequest (HTTP 400)
 $

By only the above message, it is not easy that a user understand the reason
of an error. glance-api server returns the details of reason, but glance
command does not show it.

This patch adds details, which is gotten from glance-api server, to error
message. And a user will be able to understand the reason of a error like
the following:

 $ glance image-create --file root-fs.img --name cirros-0.3.0-x86_64-uec
 Request returned failure status.
 400 Bad Request
 Invalid disk format 'None' for image.
     (HTTP 400)
 $

Fixes bug 1094917

Change-Id: I49192c3ebbc8a70b63dcfcede9fd13f1688388cf
2013-01-01 22:33:15 +09:00
Brian Waldon c057fe47d6 Document v0.7.0 release
Change-Id: I3ee1c2c558d77341e0f50415cf13a85281c4aa5d
2012-12-11 15:39:01 -08:00
Dean Troyer 4781da7007 Support --os-cacert
* Rename --ca-file to --os-cacert (--ca-file deprecated for
  backward compatibility)
* Add cacert to keystoneclient initialization to verify the
  keystone server certificate

This aligns glanceclient with keystoneclient for option naming
and the use of TLS for the keystone auth connection.  It does not
change the use of TLS/SSL for the glance connection.

Change-Id: If8b05655aea5f3c62612d77bf947dd790f77eddf
2012-12-11 14:46:33 -08:00
Brian Waldon 2500e69b22 Update --location help to reference swift store.
Fixes bug 1085575.

Change-Id: I6b325874a21e63fa02fe261f19e3d071f2b220d9
2012-12-03 15:01:34 -08:00