Commit Graph

214 Commits

Author SHA1 Message Date
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
Jenkins 7be3395c6c Merge "Change default image sort to use name" 2012-11-30 21:27:15 +00:00
Jenkins b66e6faac0 Merge "Add --sort-key and --sort-dir to image-list" 2012-11-30 21:22:23 +00:00
Brian Waldon 4fa6805242 Change default image sort to use name
Fixes bug 1081542.

Change-Id: I9e09c3fe3b6c2bfce7e37df1d29b37a42168e878
2012-11-28 09:50:46 -08:00
Brian Waldon 4da8b287b4 Add --sort-key and --sort-dir to image-list
The --sort-key and --sort-dir CLI options allow users to control the
field and direction by which their images are sorted in an image-list
operation. The previous default sort behavior of sorting by ID asc has
been preserved.

Fixes bug 1082957.

Change-Id: I1d3664219c275b0379fe176f8288d6ffae0dffbe
2012-11-28 09:46:32 -08:00
Jenkins 09c8216177 Merge "Allow setting x-image-meta-store through shell on image creation" 2012-11-26 23:20:19 +00:00
Jenkins 59b8ac198b Merge "Verify that host matches certificate" 2012-11-26 23:20:16 +00: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
Florian Haas c2ba627ec1 Allow setting x-image-meta-store through shell on image creation
Add a command line arg "--store" to "glance image-create" so users
can specify a store other than the default on image creation.

Change-Id: Icf9a894b08e405d6884964b3cfaa80250e85ed71
2012-11-24 11:22:41 +01:00
Jenkins e1955434b7 Merge "Hook up region_name argument" 2012-11-21 20:36:49 +00:00
Stuart McLaren 7a5946fd87 Verify that host matches certificate
When using https verify that the Common Name (CN) or
the Subject Alternative Name listed in the server's
certificate match the host we are connected to.

Addresses LP bug 1079692.

Change-Id: I24ea1511a2cbdb7c34ce72ac704d7b5e7d57cec2
2012-11-20 09:56:00 +00:00
Brian Waldon ae16750c48 Document bugs/features for v0.6.0
Change-Id: I8966d74eb86e52a222ddac5bc6d52d1dd699fb3d
2012-11-19 14:56:38 -08:00
Brian Waldon 3003ed8ef8 Hook up region_name argument
Connect the --os-region-name option passed through the CLI
to the call to service_catalog.url_for.

Fixes bug 1080739.

Change-Id: I2d19d62a999a82a91de3883db12bbc24e900de25
2012-11-19 12:47:54 -08:00
Jenkins 046d34c891 Merge "Simplify human-readable size output" 2012-11-19 19:39:19 +00:00
Jenkins e40580b77a Merge "Make image sizes more readable for humans" 2012-11-19 18:56:52 +00:00
Jenkins 882c13ab8c Merge "Set useful boolean flag metavars" 2012-11-19 18:52:55 +00:00
Jenkins 0192e14d56 Merge "added --version as new parameter" 2012-11-19 18:48:11 +00:00
Brian Waldon fe17d35174 Simplify human-readable size output
* Limit human-readable sizes to a single decimal
* Drop trailing zero
* Step one suffix further in the case of a size being 1024

Change-Id: I2eb8ac0571d3d08b52f62155912863870573a37c
2012-11-19 10:35:04 -08:00
Christian Berendt b24832c22a Make image sizes more readable for humans
By introducing the parameter --human-readable for several functions
(image-list, image-show, image-update, image-create) it's possible
to convert the size in bytes to something more readable like
9.309MB or 1.375GB.

Change-Id: I4e2654994361dcf330ed6d681dbed73388f159cb
2012-11-19 10:15:19 -08:00
Brian Waldon 0e90f8ef23 Set useful boolean flag metavars
The boolean flags --is-protected and --is-public now
communicate that they must be set to True or False.

Fixes bug 1056501.

Change-Id: I23094ea556eb71d6eb977a64c171119738ed792b
2012-11-19 09:08:50 -08:00
Jenkins 1899ac2963 Merge "Unpin keystoneclient dependency" 2012-11-17 00:57:15 +00:00
Vishvananda Ishaya 8d81623d5f Unpin keystoneclient dependency
The new 0.2.0 keystoneclient was released with no api changes, and
glanceclients dependency breaks gating so unpin it.

Change-Id: I9cbe2ebb462005ebfea3b7a0e68ca39069a0765f
2012-11-16 16:37:03 -08:00
Jenkins c6b9712482 Merge "Fixes bug on Windows related to a wrong API url" 2012-11-15 21:18:44 +00:00
Alessandro Pilotti 6c201e63ea Fixes bug on Windows related to a wrong API url
Fixes Bug #1079323

python-glanceclient (latest repository code) fails on Windows due to a
malformed API url. This error is due to the usage of os.path.normpath(),
which should not be used for URLs as it swaps "/" with "\" on Windows.

The fix consists in using posixpath.normpath().
Please see also https://bugs.launchpad.net/nova/+bug/1077125 and related
commit.

Change-Id: Iaa643bd579963ad9ffbf10674973cbca75d435ac
2012-11-15 20:31:10 +02:00
Andre Naehring 00eff28f28 Enhance --checksum help with algorithm
Fixes bug 1056499.

Added a line to the help text of --checksum which enhances the help text
to show what checksum algorithm is expected.

Change-Id: Ie6604022dd9f398c639afe647b2d94b5179dbb61
2012-11-14 15:37:31 +01:00
Christian Berendt e20ff23158 added --version as new parameter
fixes bug 1056504
Change-Id: Ib28e3941006b46553001d7895d5ddf4b0f9c540d
2012-11-13 12:02:14 +01:00
Alessandro Pilotti 16aafa728e Fixes setup compatibility issue on Windows
Fixes Bug #1052161

"python setup.py build" fails on Windows due to a hardcoded shell path:
/bin/sh

setup.py updated using openstack-common/update.py

Change-Id: If0ae835aeada8769e46dddf4f3c2f2edfdfbc5fe
2012-11-05 18:19:13 +02:00
Jenkins a8e88aa340 Merge "Allow deletion of multiple images through CLI" 2012-10-25 02:23:49 +00:00
Sulochan Acharya 8b2c227f27 Allow deletion of multiple images through CLI
Add nargs to argparse for image-delete command to
allow muliple (optional) positional image-id arguments.
For example:
image-delete xxx aaa yyy will delete valid images
xxx and yyy and print error message for invalid image
aaa. Also with --verbose you can see some extra text
on delete request for each image.

Fixes bug1056498.

Change-Id: I6e804700ed24d16f90ec92569c0893cad4aaa26f
2012-10-24 06:06:50 -05:00
Jenkins 256dcbae1c Merge "Fixes shell command for member-delete" 2012-10-24 02:53:46 +00:00
Sulochan Acharya 1e14e82c81 Fixes shell command for member-delete
Fixes the member-delete cli command and string formatting for
dry-run option.
Fixes bug1064320

Change-Id: I338f03d53da5c9b7656ae4d1335de9623b774dd8
2012-10-23 08:15:55 -05:00
Doug Hellmann c420fa10fe Add OpenStack trove classifier for PyPI
Add trove classifier to have the client listed among the
other OpenStack-related projets on PyPI.

Change-Id: I2bb290f529fd2cd08d0093f495074d8e1683d91f
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-10-22 18:43:53 -04:00
Jenkins 9004ee40df Merge "Display acceptable disk/container formats in help text" 2012-10-13 02:54:09 +00:00
Jenkins 3576336cb9 Merge "Handle create/update of images with unknown size" 2012-10-13 02:17:31 +00:00
Stuart McLaren 556082cd66 Implement blueprint ssl-connect-rework
Use pyOpenSSL for HTTPS connections.

This allows:

* Neater loading of system CA files
* Optional disabling of SSL compression

The performance gain from disabling SSL compression is significant
in cases where the image being uploaded/downloaded is in an already
compressed format (eg qcow2).

Related to bp ssl-connect-rework.

Change-Id: I0568b6c95c5fc7b8eafdbd0284e24c453660a55a
2012-10-08 13:51:41 +00:00
Stuart McLaren 727aadbc25 Handle create/update of images with unknown size
It may not be possible to know in advance the total
size of image data which is to be uploaded, for example
if the data is being piped to stdin.

To handle this we use HTTP Transfer-Encoding: chunked
and do not set any image size headers.

Various subtly different cases needed to be handled for
both image-create and image-update, including:

 * input from named pipe
 * piped input of zero size
 * regular file of zero length

Fix for bug 1056220.

Change-Id: I0c7f0a64d883e058993b954a1c465c5b057f2bcf
2012-10-08 11:16:18 +00:00
Brian Waldon b5d46e2e0d Display acceptable disk/container formats in help text
Fixes bug #1056497

This patch provides more information in the help text. Originally the text
provided the trivial definitions of the arguments disk_format and
container_format. This patch updates the text to display the acceptable
formats.

Change-Id: I893b52c9f72a34c75e8bea522820863592300302
2012-10-04 06:28:41 -07:00
Brian Waldon cdc06d9fdb Simplify http(s) connection instantiation
The endpoint parsing and connection instantiation code was too
complicated and easily broken. This assigns human-readable names to
instance variables and breaks up the parsing into more understandable
chunks.

Fixes bug 1060316.

Change-Id: I5c5236f90d88b9e797cf0a476aabe8cc7cfa1cc9
2012-10-03 14:10:11 -07:00
Brian Waldon 11e6aadf19 Add happy path tests for ResponseBodyIterator
Change-Id: I5e971b57a0591752e7fca76d0df78ce139308db5
2012-10-02 09:19:37 -07:00