Return CF Stack events in reverse chronological order (#853)
This is how the AWS API works: http://boto3.readthedocs.io/en/latest/reference/services/cloudformation.html#CloudFormation.Client.describe_stack_events
This commit is contained in:
parent
9b6d3983d2
commit
f6465df630
@ -292,7 +292,7 @@ DESCRIBE_STACK_RESOURCES_RESPONSE = """<DescribeStackResourcesResponse>
|
|||||||
DESCRIBE_STACK_EVENTS_RESPONSE = """<DescribeStackEventsResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
|
DESCRIBE_STACK_EVENTS_RESPONSE = """<DescribeStackEventsResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
|
||||||
<DescribeStackEventsResult>
|
<DescribeStackEventsResult>
|
||||||
<StackEvents>
|
<StackEvents>
|
||||||
{% for event in stack.events %}
|
{% for event in stack.events[::-1] %}
|
||||||
<member>
|
<member>
|
||||||
<Timestamp>{{ event.timestamp.strftime('%Y-%m-%dT%H:%M:%S.%fZ') }}</Timestamp>
|
<Timestamp>{{ event.timestamp.strftime('%Y-%m-%dT%H:%M:%S.%fZ') }}</Timestamp>
|
||||||
<ResourceStatus>{{ event.resource_status }}</ResourceStatus>
|
<ResourceStatus>{{ event.resource_status }}</ResourceStatus>
|
||||||
|
@ -509,10 +509,15 @@ def test_describe_stack_events_shows_create_update_and_delete():
|
|||||||
events[-1].resource_type.should.equal("AWS::CloudFormation::Stack")
|
events[-1].resource_type.should.equal("AWS::CloudFormation::Stack")
|
||||||
|
|
||||||
# testing ordering of stack events without assuming resource events will not exist
|
# testing ordering of stack events without assuming resource events will not exist
|
||||||
|
# the AWS API returns events in reverse chronological order
|
||||||
stack_events_to_look_for = iter([
|
stack_events_to_look_for = iter([
|
||||||
("CREATE_IN_PROGRESS", "User Initiated"), ("CREATE_COMPLETE", None),
|
("DELETE_COMPLETE", None),
|
||||||
("UPDATE_IN_PROGRESS", "User Initiated"), ("UPDATE_COMPLETE", None),
|
("DELETE_IN_PROGRESS", "User Initiated"),
|
||||||
("DELETE_IN_PROGRESS", "User Initiated"), ("DELETE_COMPLETE", None)])
|
("UPDATE_COMPLETE", None),
|
||||||
|
("UPDATE_IN_PROGRESS", "User Initiated"),
|
||||||
|
("CREATE_COMPLETE", None),
|
||||||
|
("CREATE_IN_PROGRESS", "User Initiated"),
|
||||||
|
])
|
||||||
try:
|
try:
|
||||||
for event in events:
|
for event in events:
|
||||||
event.stack_id.should.equal(stack_id)
|
event.stack_id.should.equal(stack_id)
|
||||||
|
@ -345,10 +345,15 @@ def test_stack_events():
|
|||||||
events[-1].resource_type.should.equal("AWS::CloudFormation::Stack")
|
events[-1].resource_type.should.equal("AWS::CloudFormation::Stack")
|
||||||
|
|
||||||
# testing ordering of stack events without assuming resource events will not exist
|
# testing ordering of stack events without assuming resource events will not exist
|
||||||
|
# the AWS API returns events in reverse chronological order
|
||||||
stack_events_to_look_for = iter([
|
stack_events_to_look_for = iter([
|
||||||
("CREATE_IN_PROGRESS", "User Initiated"), ("CREATE_COMPLETE", None),
|
("DELETE_COMPLETE", None),
|
||||||
("UPDATE_IN_PROGRESS", "User Initiated"), ("UPDATE_COMPLETE", None),
|
("DELETE_IN_PROGRESS", "User Initiated"),
|
||||||
("DELETE_IN_PROGRESS", "User Initiated"), ("DELETE_COMPLETE", None)])
|
("UPDATE_COMPLETE", None),
|
||||||
|
("UPDATE_IN_PROGRESS", "User Initiated"),
|
||||||
|
("CREATE_COMPLETE", None),
|
||||||
|
("CREATE_IN_PROGRESS", "User Initiated"),
|
||||||
|
])
|
||||||
try:
|
try:
|
||||||
for event in events:
|
for event in events:
|
||||||
event.stack_id.should.equal(stack.stack_id)
|
event.stack_id.should.equal(stack.stack_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user