Add or change timestamp suffixes to "_at"

The great majority of our time related properties on resources are named
"something_at". That started because the body values in responses in a
number of resources are actually named that, and we seem to have
converged on that naming scheme over "something", as that could in some
cases appear as a boolean (updated? Is it true, is it the time, etc).
This change corrects a few that were un-suffixed or that had a different
suffix. We should now be consistent on time related properties.

Change-Id: I4bed7344a156df5dfce62af5c28bbffad3b5857e
This commit is contained in:
Brian Curtin 2015-07-08 15:36:58 -05:00
parent dbe995f8cf
commit 84ef66e307
13 changed files with 23 additions and 23 deletions

View File

@ -38,7 +38,7 @@ class Snapshot(resource.Resource):
#: Description of snapshot. Default is None.
description = resource.prop("description")
#: The timestamp of this snapshot creation.
created = resource.prop("created_at")
created_at = resource.prop("created_at")
#: Metadata associated with this snapshot.
metadata = resource.prop("metadata", type=dict)
#: The ID of the volume this snapshot was taken of.

View File

@ -42,12 +42,12 @@ class Cluster(resource.Resource):
#: The ID of the parent cluster (if any).
parent = resource.prop('parent')
#: Timestamp of when the cluster was created.
created_time = resource.prop('created_time')
created_at = resource.prop('created_time')
#: Timestamp of when the cluster was last updated.
updated_time = resource.prop('updated_time')
updated_at = resource.prop('updated_time')
#: Timestamp of when the cluster was deleted. This is only used on
#: clusters that were soft-deleted.
deleted_time = resource.prop('deleted_time')
deleted_at = resource.prop('deleted_time')
#: Lower bound (inclusive) for the size of the cluster.
min_size = resource.prop('min_size', type=int)
#: Upper bound (inclusive) for the size of the cluster. A value of

View File

@ -32,7 +32,7 @@ class Image(resource.Resource):
#: The name of this image.
name = resource.prop('name')
#: Timestamp when the image was created.
created = resource.prop('created')
created_at = resource.prop('created')
#: Metadata pertaining to this image. *Type: dict*
metadata = resource.prop('metadata', type=dict)
#: The mimimum disk size. *Type: int*
@ -45,7 +45,7 @@ class Image(resource.Resource):
#: The status of this image.
status = resource.prop('status')
#: Timestamp when the image was updated.
updated = resource.prop('updated')
updated_at = resource.prop('updated')
#: Size of the image in bytes. *Type: int*
size = resource.prop('OS-EXT-IMG-SIZE:size', type=int)

View File

@ -31,7 +31,7 @@ class Container(resource.Resource):
#: A URI for this container
container_ref = resource.prop('container_ref')
#: The timestamp when this container was created
created = resource.prop('created')
created_at = resource.prop('created')
#: The name of this container
name = resource.prop('name')
#: A list of references to secrets in this container
@ -41,4 +41,4 @@ class Container(resource.Resource):
#: The type of this container
type = resource.prop('type')
#: The timestamp when this container was updated
updated = resource.prop('updated')
updated_at = resource.prop('updated')

View File

@ -37,7 +37,7 @@ class Secret(resource.Resource):
#: A list of content types
content_types = resource.prop('content_types')
#: Once this timestamp has past, the secret will no longer be available.
expiration = resource.prop('expiration')
expires_at = resource.prop('expiration')
#: The type/mode of the algorithm associated with the secret information.
mode = resource.prop('mode')
#: The name of the secret set by the user
@ -47,4 +47,4 @@ class Secret(resource.Resource):
#: The status of this secret
status = resource.prop('status')
#: A timestamp when this secret was updated
updated = resource.prop('updated')
updated_at = resource.prop('updated')

View File

@ -49,4 +49,4 @@ class Resource(resource.Resource):
#: A string that explains why the resource is in its current status.
status_reason = resource.prop('resource_status_reason')
#: Timestamp of the last update made to the resource.
updated_time = resource.prop('updated_time')
updated_at = resource.prop('updated_time')

View File

@ -35,7 +35,7 @@ class Stack(resource.Resource):
#: required by the stack.
capabilities = resource.prop('capabilities')
#: Timestamp of the stack creation.
creation_time = resource.prop('creation_time')
created_at = resource.prop('creation_time')
#: A text decription of the stack.
description = resource.prop('description')
#: Whether the stack will support a rollback operation on stack
@ -62,7 +62,7 @@ class Stack(resource.Resource):
#: Stack operation timeout in minutes.
timeout_mins = resource.prop('timeout_mins')
#: Timestamp of last update on the stack.
updated_time = resource.prop('updated_time')
updated_at = resource.prop('updated_time')
def _action(self, session, body):
"""Perform stack actions"""

View File

@ -56,7 +56,7 @@ class TestSnapshot(testtools.TestCase):
sot = snapshot.Snapshot(SNAPSHOT)
self.assertEqual(SNAPSHOT["id"], sot.id)
self.assertEqual(SNAPSHOT["status"], sot.status)
self.assertEqual(SNAPSHOT["created_at"], sot.created)
self.assertEqual(SNAPSHOT["created_at"], sot.created_at)
self.assertEqual(SNAPSHOT["metadata"], sot.metadata)
self.assertEqual(SNAPSHOT["volume_id"], sot.volume)
self.assertEqual(SNAPSHOT["size"], sot.size)

View File

@ -70,7 +70,7 @@ class TestImage(testtools.TestCase):
def test_make_detail(self):
sot = image.ImageDetail(DETAIL_EXAMPLE)
self.assertEqual(DETAIL_EXAMPLE['created'], sot.created)
self.assertEqual(DETAIL_EXAMPLE['created'], sot.created_at)
self.assertEqual(DETAIL_EXAMPLE['id'], sot.id)
self.assertEqual(DETAIL_EXAMPLE['links'], sot.links)
self.assertEqual(DETAIL_EXAMPLE['metadata'], sot.metadata)
@ -79,5 +79,5 @@ class TestImage(testtools.TestCase):
self.assertEqual(DETAIL_EXAMPLE['name'], sot.name)
self.assertEqual(DETAIL_EXAMPLE['progress'], sot.progress)
self.assertEqual(DETAIL_EXAMPLE['status'], sot.status)
self.assertEqual(DETAIL_EXAMPLE['updated'], sot.updated)
self.assertEqual(DETAIL_EXAMPLE['updated'], sot.updated_at)
self.assertEqual(DETAIL_EXAMPLE['OS-EXT-IMG-SIZE:size'], sot.size)

View File

@ -43,10 +43,10 @@ class TestContainer(testtools.TestCase):
def test_make_it(self):
sot = container.Container(EXAMPLE)
self.assertEqual(EXAMPLE['container_ref'], sot.container_ref)
self.assertEqual(EXAMPLE['created'], sot.created)
self.assertEqual(EXAMPLE['created'], sot.created_at)
self.assertEqual(EXAMPLE['name'], sot.name)
self.assertEqual(EXAMPLE['secret_refs'], sot.secret_refs)
self.assertEqual(EXAMPLE['status'], sot.status)
self.assertEqual(EXAMPLE['type'], sot.type)
self.assertEqual(EXAMPLE['updated'], sot.updated)
self.assertEqual(EXAMPLE['updated'], sot.updated_at)
self.assertEqual(EXAMPLE['container_ref'], sot.id)

View File

@ -47,10 +47,10 @@ class TestSecret(testtools.TestCase):
self.assertEqual(EXAMPLE['algorithm'], sot.algorithm)
self.assertEqual(EXAMPLE['bit_length'], sot.bit_length)
self.assertEqual(EXAMPLE['content_types'], sot.content_types)
self.assertEqual(EXAMPLE['expiration'], sot.expiration)
self.assertEqual(EXAMPLE['expiration'], sot.expires_at)
self.assertEqual(EXAMPLE['mode'], sot.mode)
self.assertEqual(EXAMPLE['name'], sot.name)
self.assertEqual(EXAMPLE['secret_ref'], sot.secret_ref)
self.assertEqual(EXAMPLE['status'], sot.status)
self.assertEqual(EXAMPLE['updated'], sot.updated)
self.assertEqual(EXAMPLE['updated'], sot.updated_at)
self.assertEqual(EXAMPLE['secret_ref'], sot.id)

View File

@ -62,4 +62,4 @@ class TestResource(testtools.TestCase):
self.assertEqual(FAKE['resource_type'], sot.resource_type)
self.assertEqual(FAKE['status'], sot.status)
self.assertEqual(FAKE['status_reason'], sot.status_reason)
self.assertEqual(FAKE['updated_time'], sot.updated_time)
self.assertEqual(FAKE['updated_time'], sot.updated_at)

View File

@ -62,7 +62,7 @@ class TestStack(testtools.TestCase):
def test_make_it(self):
sot = stack.Stack(FAKE)
self.assertEqual(FAKE['capabilities'], sot.capabilities)
self.assertEqual(FAKE['creation_time'], sot.creation_time)
self.assertEqual(FAKE['creation_time'], sot.created_at)
self.assertEqual(FAKE['description'], sot.description)
self.assertEqual(FAKE['disable_rollback'], sot.disable_rollback)
self.assertEqual(FAKE['id'], sot.id)
@ -80,7 +80,7 @@ class TestStack(testtools.TestCase):
self.assertEqual(FAKE['template_url'],
sot.template_url)
self.assertEqual(FAKE['timeout_mins'], sot.timeout_mins)
self.assertEqual(FAKE['updated_time'], sot.updated_time)
self.assertEqual(FAKE['updated_time'], sot.updated_at)
def test_create(self):
resp = mock.MagicMock()