Merge "Show the creation time for stack snapshots"
This commit is contained in:
commit
6da179356b
heat
@ -390,5 +390,7 @@ def format_snapshot(snapshot):
|
|||||||
rpc_api.SNAPSHOT_STATUS: snapshot.status,
|
rpc_api.SNAPSHOT_STATUS: snapshot.status,
|
||||||
rpc_api.SNAPSHOT_STATUS_REASON: snapshot.status_reason,
|
rpc_api.SNAPSHOT_STATUS_REASON: snapshot.status_reason,
|
||||||
rpc_api.SNAPSHOT_DATA: snapshot.data,
|
rpc_api.SNAPSHOT_DATA: snapshot.data,
|
||||||
|
rpc_api.SNAPSHOT_CREATION_TIME: timeutils.isotime(
|
||||||
|
snapshot.created_at),
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
@ -235,14 +235,16 @@ SNAPSHOT_KEYS = (
|
|||||||
SNAPSHOT_STACK_ID,
|
SNAPSHOT_STACK_ID,
|
||||||
SNAPSHOT_DATA,
|
SNAPSHOT_DATA,
|
||||||
SNAPSHOT_STATUS,
|
SNAPSHOT_STATUS,
|
||||||
SNAPSHOT_STATUS_REASON
|
SNAPSHOT_STATUS_REASON,
|
||||||
|
SNAPSHOT_CREATION_TIME,
|
||||||
) = (
|
) = (
|
||||||
'id',
|
'id',
|
||||||
'name',
|
'name',
|
||||||
'stack_id',
|
'stack_id',
|
||||||
'data',
|
'data',
|
||||||
'status',
|
'status',
|
||||||
'status_reason'
|
'status_reason',
|
||||||
|
'creation_time'
|
||||||
)
|
)
|
||||||
|
|
||||||
THREAD_MESSAGES = (THREAD_CANCEL,) = ('cancel',)
|
THREAD_MESSAGES = (THREAD_CANCEL,) = ('cancel',)
|
||||||
|
@ -3588,6 +3588,7 @@ class SnapshotServiceTest(common.HeatTestCase):
|
|||||||
snapshot = self.engine.stack_snapshot(
|
snapshot = self.engine.stack_snapshot(
|
||||||
self.ctx, stack.identifier(), 'snap1')
|
self.ctx, stack.identifier(), 'snap1')
|
||||||
self.assertIsNotNone(snapshot['id'])
|
self.assertIsNotNone(snapshot['id'])
|
||||||
|
self.assertIsNotNone(snapshot['creation_time'])
|
||||||
self.assertEqual('snap1', snapshot['name'])
|
self.assertEqual('snap1', snapshot['name'])
|
||||||
self.assertEqual("IN_PROGRESS", snapshot['status'])
|
self.assertEqual("IN_PROGRESS", snapshot['status'])
|
||||||
self.engine.thread_group_mgr.groups[stack.id].wait()
|
self.engine.thread_group_mgr.groups[stack.id].wait()
|
||||||
@ -3598,6 +3599,7 @@ class SnapshotServiceTest(common.HeatTestCase):
|
|||||||
self.assertEqual("COMPLETE", snapshot['data']['status'])
|
self.assertEqual("COMPLETE", snapshot['data']['status'])
|
||||||
self.assertEqual(stack.id, snapshot['data']['id'])
|
self.assertEqual(stack.id, snapshot['data']['id'])
|
||||||
self.assertIsNotNone(stack.updated_time)
|
self.assertIsNotNone(stack.updated_time)
|
||||||
|
self.assertIsNotNone(snapshot['creation_time'])
|
||||||
|
|
||||||
def test_delete_snapshot_not_found(self):
|
def test_delete_snapshot_not_found(self):
|
||||||
stack = self._create_stack()
|
stack = self._create_stack()
|
||||||
@ -3638,7 +3640,8 @@ class SnapshotServiceTest(common.HeatTestCase):
|
|||||||
"name": "snap1",
|
"name": "snap1",
|
||||||
"status": "COMPLETE",
|
"status": "COMPLETE",
|
||||||
"status_reason": "Stack SNAPSHOT completed successfully",
|
"status_reason": "Stack SNAPSHOT completed successfully",
|
||||||
"data": stack.prepare_abandon()}
|
"data": stack.prepare_abandon(),
|
||||||
|
"creation_time": snapshot['creation_time']}
|
||||||
self.assertEqual([expected], snapshots)
|
self.assertEqual([expected], snapshots)
|
||||||
|
|
||||||
def test_restore_snapshot(self):
|
def test_restore_snapshot(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user