VijayantSoni commented on a change in pull request #9011:
URL: https://github.com/apache/airflow/pull/9011#discussion_r455261874
##########
File path: airflow/providers/amazon/aws/hooks/ec2.py
##########
@@ -58,7 +127,7 @@ def get_instance_state(self, instance_id: str) -> str:
:return: current state of the instance
:rtype: str
"""
- return self.get_instance(instance_id=instance_id).state["Name"]
+ return
self.get_instances(instance_ids=[instance_id])[0][self.STATE][self.NAME]
Review comment:
`get_instances` would fail in that case with following error:
```
botocore.exceptions.ClientError: An error occurred
(InvalidInstanceID.Malformed) when calling the DescribeInstances operation:
Invalid id: "<instance_id>"
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]