From e201e460dfa3fbc9a3f0b8b17d11a98ff754f68e Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Fri, 12 Feb 2016 08:27:27 -0600 Subject: [PATCH] Basic resource.prop for ID attributes (image) This patch set updates all image resource objects to use basic properties for ID attributes. In particular, the following changes were made: - Use basic *_id resource.prop for ID attributes - Clarify documentation for ID attributes Change-Id: Ia2f65f566e6b5a03e865ce26122cd567712a08f1 Partial-Bug: #1461200 --- openstack/image/v1/_proxy.py | 2 +- openstack/image/v1/image.py | 4 ++-- openstack/image/v2/_proxy.py | 4 ++-- openstack/image/v2/image.py | 4 ++-- openstack/tests/unit/image/v1/test_image.py | 2 +- openstack/tests/unit/image/v2/test_image.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openstack/image/v1/_proxy.py b/openstack/image/v1/_proxy.py index d1ffe2d6..aa4ba6fb 100644 --- a/openstack/image/v1/_proxy.py +++ b/openstack/image/v1/_proxy.py @@ -83,7 +83,7 @@ class Proxy(proxy.BaseProxy): def update_image(self, image, **attrs): """Update a image - :param image: Either the id of a image or a + :param image: Either the ID of a image or a :class:`~openstack.image.v1.image.Image` instance. :attrs kwargs: The attributes to update on the image represented by ``value``. diff --git a/openstack/image/v1/image.py b/openstack/image/v1/image.py index 84e9f73d..92cda0ad 100644 --- a/openstack/image/v1/image.py +++ b/openstack/image/v1/image.py @@ -55,8 +55,8 @@ class Image(resource.Resource): #: to a Glance node. The API cannot expect users to know the names #: of images owned by others. name = resource.prop('name') - #: The ID of the owner, or tenant, of the image. - owner = resource.prop('owner') + #: The ID of the owner, or project, of the image. + owner_id = resource.prop('owner') #: Properties, if any, that are associated with the image. properties = resource.prop('properties') #: Defines whether the image can be deleted. diff --git a/openstack/image/v2/_proxy.py b/openstack/image/v2/_proxy.py index 6b5d8929..db4d51f1 100644 --- a/openstack/image/v2/_proxy.py +++ b/openstack/image/v2/_proxy.py @@ -92,7 +92,7 @@ class Proxy(proxy.BaseProxy): def update_image(self, image, **attrs): """Update a image - :param image: Either the id of a image or a + :param image: Either the ID of a image or a :class:`~openstack.image.v2.image.Image` instance. :attrs kwargs: The attributes to update on the image represented by ``value``. @@ -169,7 +169,7 @@ class Proxy(proxy.BaseProxy): def update_member(self, member, **attrs): """Update a member - :param member: Either the id of a member or a + :param member: Either the ID of a member or a :class:`~openstack.image.v2.member.Member` instance. :attrs kwargs: The attributes to update on the member represented by ``value``. diff --git a/openstack/image/v2/image.py b/openstack/image/v2/image.py index 179ffbf2..6bd16baf 100644 --- a/openstack/image/v2/image.py +++ b/openstack/image/v2/image.py @@ -53,8 +53,8 @@ class Image(resource.Resource): min_disk = resource.prop('min_disk') #: The name of the image. name = resource.prop('name') - #: The ID of the owner, or tenant, of the image. - owner = resource.prop('owner') + #: The ID of the owner, or project, of the image. + owner_id = resource.prop('owner') #: Properties, if any, that are associated with the image. properties = resource.prop('properties') #: Defines whether the image can be deleted. diff --git a/openstack/tests/unit/image/v1/test_image.py b/openstack/tests/unit/image/v1/test_image.py index 87f2e8fc..faad8b18 100644 --- a/openstack/tests/unit/image/v1/test_image.py +++ b/openstack/tests/unit/image/v1/test_image.py @@ -62,7 +62,7 @@ class TestImage(testtools.TestCase): self.assertEqual(EXAMPLE['min_disk'], sot.min_disk) self.assertEqual(EXAMPLE['min_ram'], sot.min_ram) self.assertEqual(EXAMPLE['name'], sot.name) - self.assertEqual(EXAMPLE['owner'], sot.owner) + self.assertEqual(EXAMPLE['owner'], sot.owner_id) self.assertEqual(EXAMPLE['properties'], sot.properties) self.assertEqual(EXAMPLE['protected'], sot.protected) self.assertEqual(EXAMPLE['size'], sot.size) diff --git a/openstack/tests/unit/image/v2/test_image.py b/openstack/tests/unit/image/v2/test_image.py index d8eb99b7..94459fb6 100644 --- a/openstack/tests/unit/image/v2/test_image.py +++ b/openstack/tests/unit/image/v2/test_image.py @@ -58,7 +58,7 @@ class TestImage(testtools.TestCase): self.assertEqual(EXAMPLE['disk_format'], sot.disk_format) self.assertEqual(EXAMPLE['min_disk'], sot.min_disk) self.assertEqual(EXAMPLE['name'], sot.name) - self.assertEqual(EXAMPLE['owner'], sot.owner) + self.assertEqual(EXAMPLE['owner'], sot.owner_id) self.assertEqual(EXAMPLE['properties'], sot.properties) self.assertEqual(EXAMPLE['protected'], sot.protected) self.assertEqual(EXAMPLE['status'], sot.status)