David Koo 3c5efdb74e Allow updating empty created v2 images from v1
When an empty image is created through python-glanceclient using v2 APIs
but updated using v1 APIs, python-glanceclient crashes with a "int()
argument must be a string or a number, not 'NoneType'" message.

This is because v1.images.ImageManager._format_image_meta_for_user
expects the 'size' (and 'min_ram' and 'min_disk') field of an image to
be convertible to 'int' but the server-side v2 APIs set it to 'None' for
an empty image. Therefore the conversion to int fails with the message
above.

This fix modifies _format_image_meta_for_user to check whether or not a
field can be converted to 'int' and, if not, returns 0 (zero) as the
value instead.

Tests have also been added.

Change-Id: I86680bc06c8ce3ee492efeb3f32071da4f293bcd
Closes-bug: #1258160
2014-01-20 09:46:58 +08:00
2014-01-01 11:39:31 +08:00
2013-02-06 16:47:06 +02:00
2013-12-04 08:09:58 +00:00
2012-04-03 20:50:44 -06:00
2013-01-16 18:39:18 -05:00
2013-11-11 10:52:07 -08:00
2012-03-26 22:48:48 -07:00
2013-02-07 05:10:08 -06:00
2013-06-22 16:00:26 +02:00
2013-05-18 09:02:07 -07:00
2013-12-10 22:21:31 +00:00
2013-12-23 05:10:08 +00:00

Python bindings to the OpenStack Images API
=============================================

This is a client library for Glance built on the OpenStack Images API. It provides a Python API (the ``glanceclient`` module) and a command-line tool (``glance``). This library fully supports the v1 Images API, while support for the v2 API is in progress.

Development takes place via the usual OpenStack processes as outlined in the `OpenStack wiki <http://wiki.openstack.org/HowToContribute>`_.  The master repository is on `GitHub <http://github.com/openstack/python-glanceclient>`_.

See release notes and more at `<http://docs.openstack.org/developer/python-glanceclient/>`_.
S
Description
No description provided
Readme 1.7 MiB
Languages
Python 99.4%
Shell 0.6%