Add StateTransitionReason to ec2:DescribeInstances response (#7495)

This commit is contained in:
Brian Pandola 2024-03-19 16:51:34 -07:00 committed by GitHub
parent 009d0191f9
commit 3e90012509
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -463,7 +463,7 @@ INSTANCE_TEMPLATE = """<item>
<privateDnsName>{{ instance.private_dns }}</privateDnsName>
<publicDnsName>{{ instance.public_dns }}</publicDnsName>
<dnsName>{{ instance.public_dns }}</dnsName>
<reason/>
<reason>{{ instance._reason }}</reason>
{% if instance.key_name is not none %}
<keyName>{{ instance.key_name }}</keyName>
{% endif %}

View File

@ -973,6 +973,7 @@ def test_instance_start_and_stop():
instance1.reload()
assert instance1.state == {"Code": 80, "Name": "stopped"}
assert instance1.state_transition_reason.startswith("User initiated")
with pytest.raises(ClientError) as ex:
client.start_instances(InstanceIds=[instance1.id], DryRun=True)