From 0b2b2e8d1a4753eed1577b0fbbff1ae270629fa2 Mon Sep 17 00:00:00 2001 From: Limor Stotland Date: Tue, 5 May 2015 09:08:10 +0000 Subject: [PATCH] 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 --- heat/engine/api.py | 2 ++ heat/rpc/api.py | 4 ++-- heat/tests/test_engine_api_utils.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/heat/engine/api.py b/heat/engine/api.py index 3fc0509836..08020ec886 100644 --- a/heat/engine/api.py +++ b/heat/engine/api.py @@ -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, diff --git a/heat/rpc/api.py b/heat/rpc/api.py index 8221b92d1e..a36c6d7411 100644 --- a/heat/rpc/api.py +++ b/heat/rpc/api.py @@ -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, diff --git a/heat/tests/test_engine_api_utils.py b/heat/tests/test_engine_api_utils.py index 85c3aae2b9..54e7ddbec7 100644 --- a/heat/tests/test_engine_api_utils.py +++ b/heat/tests/test_engine_api_utils.py @@ -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,