diff options
| author | Brian Waldon <bcwaldon@gmail.com> | 2012-08-13 10:30:43 -0700 |
|---|---|---|
| committer | Brian Waldon <bcwaldon@gmail.com> | 2012-08-13 10:55:43 -0700 |
| commit | 8f0d5c4f2cea6e5dae827b5f728c54dab4a4386b (patch) | |
| tree | fca43aff37869a671b705688ff9a74d31f1b60af /glanceclient | |
| parent | 1e539dfdbecfdcf33d57ef79b9f845b90f547506 (diff) | |
| download | python-glanceclient-8f0d5c4f2cea6e5dae827b5f728c54dab4a4386b.tar.gz | |
Cast is_public, protected, deleted to bool
To keep a consistent view of an image, is_public, protected, and
deleted need to be cast to a bool when being parsed from headers.
Fix bug 1036299
Change-Id: I2730a0f2d705d26ebc0ba883e99c1caf44d70b51
Diffstat (limited to 'glanceclient')
| -rw-r--r-- | glanceclient/v1/images.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glanceclient/v1/images.py b/glanceclient/v1/images.py index 7a1d84a..c77d280 100644 --- a/glanceclient/v1/images.py +++ b/glanceclient/v1/images.py @@ -57,6 +57,11 @@ class ImageManager(base.Manager): elif key.startswith('x-image-meta-'): _key = key[13:] meta[_key] = value + + for key in ['is_public', 'protected', 'deleted']: + if key in meta: + meta[key] = utils.string_to_bool(meta[key]) + return self._format_image_meta_for_user(meta) def _image_meta_to_headers(self, fields): |
