Expose create time in stack resource list:

* This will help with identified when the stack resource was created and when it was updated

   * Unity with the output of stack list

Change-Id: I48bc387ea7e5855fc37d94c0fee12496692a21c1
This commit is contained in:
Limor Stotland 2015-05-05 09:08:10 +00:00
parent 4fcfdf1e71
commit 0b2b2e8d1a
3 changed files with 6 additions and 2 deletions

View File

@ -183,8 +183,10 @@ def format_stack_resource(resource, detail=True, with_props=False,
expectations.
'''
last_updated_time = resource.updated_time or resource.created_time
created_time = resource.created_time
res = {
rpc_api.RES_UPDATED_TIME: timeutils.isotime(last_updated_time),
rpc_api.RES_CREATION_TIME: timeutils.isotime(created_time),
rpc_api.RES_NAME: resource.name,
rpc_api.RES_PHYSICAL_ID: resource.resource_id or '',
rpc_api.RES_ACTION: resource.action,

View File

@ -59,14 +59,14 @@ STACK_OUTPUT_KEYS = (
)
RES_KEYS = (
RES_DESCRIPTION, RES_UPDATED_TIME,
RES_DESCRIPTION, RES_CREATION_TIME, RES_UPDATED_TIME,
RES_NAME, RES_PHYSICAL_ID, RES_METADATA,
RES_ACTION, RES_STATUS, RES_STATUS_DATA,
RES_TYPE, RES_ID, RES_STACK_ID, RES_STACK_NAME,
RES_REQUIRED_BY, RES_NESTED_STACK_ID, RES_NESTED_RESOURCES,
RES_PARENT_RESOURCE,
) = (
'description', 'updated_time',
'description', 'creation_time', 'updated_time',
'resource_name', 'physical_resource_id', 'metadata',
'resource_action', 'resource_status', 'resource_status_reason',
'resource_type', 'resource_identity', STACK_ID, STACK_NAME,

View File

@ -68,6 +68,7 @@ class FormatTest(common.HeatTestCase):
res = self.stack['generic1']
resource_keys = set((
rpc_api.RES_CREATION_TIME,
rpc_api.RES_UPDATED_TIME,
rpc_api.RES_NAME,
rpc_api.RES_PHYSICAL_ID,
@ -194,6 +195,7 @@ class FormatTest(common.HeatTestCase):
res.nested.return_value = None
resource_keys = set((
rpc_api.RES_CREATION_TIME,
rpc_api.RES_UPDATED_TIME,
rpc_api.RES_NAME,
rpc_api.RES_PHYSICAL_ID,