diff --git a/openstack/image/v2/_proxy.py b/openstack/image/v2/_proxy.py index b539b6699..9f9d56226 100644 --- a/openstack/image/v2/_proxy.py +++ b/openstack/image/v2/_proxy.py @@ -26,6 +26,7 @@ from openstack import utils # Rackspace returns this for intermittent import errors _IMAGE_ERROR_396 = "Image cannot be imported. Error code: '396'" _INT_PROPERTIES = ('min_disk', 'min_ram', 'size', 'virtual_size') +_RAW_PROPERTIES = ('protected', 'tags') class Proxy(_base_proxy.BaseImageProxy): @@ -184,7 +185,7 @@ class Proxy(_base_proxy.BaseImageProxy): for k, v in iter(properties.items()): if k in _INT_PROPERTIES: ret[k] = int(v) - elif k == 'protected': + elif k in _RAW_PROPERTIES: ret[k] = v else: if v is None: diff --git a/openstack/image/v2/image.py b/openstack/image/v2/image.py index 13e9ff33c..dd789d5ba 100644 --- a/openstack/image/v2/image.py +++ b/openstack/image/v2/image.py @@ -104,8 +104,6 @@ class Image(resource.Resource, resource.TagMixin, _download.DownloadMixin): store = resource.Body('store') #: The image status. status = resource.Body('status') - #: Tags, if any, that are associated with the image. - tags = resource.Body('tags') #: The date and time when the image was updated. updated_at = resource.Body('updated_at') #: The virtual size of the image. diff --git a/openstack/tests/unit/cloud/test_image.py b/openstack/tests/unit/cloud/test_image.py index 78c56c4b4..12aec72fd 100644 --- a/openstack/tests/unit/cloud/test_image.py +++ b/openstack/tests/unit/cloud/test_image.py @@ -339,7 +339,8 @@ class TestImage(BaseTestImage): u'owner_specified.openstack.sha256': self.fake_image_dict[ 'owner_specified.openstack.sha256'], - u'visibility': u'private'}) + u'visibility': u'private', + u'tags': [u'tag1', u'tag2']}) ), dict(method='PUT', uri=self.get_mock_url( @@ -360,6 +361,7 @@ class TestImage(BaseTestImage): self.cloud.create_image( self.image_name, self.imagefile.name, wait=True, timeout=1, + tags=['tag1', 'tag2'], is_public=False) self.assert_calls()