Merge "Fix race in test_aws_resource_cleanup"

This commit is contained in:
Zuul 2022-07-01 03:05:18 +00:00 committed by Gerrit Code Review
commit e27ce0e8d1

View File

@ -526,7 +526,9 @@ class TestDriverAws(tests.DBTestCase):
image = self.ec2.Image(image_id)
try:
# If this has a value the image was not deleted
self.assertIsNone(image.state)
if image.state == 'available':
# Definitely not deleted yet
continue
except AttributeError:
# Per AWS API, a recently deleted image is empty and
# looking at the state raises an AttributeFailure; see