We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6218fdc + c4017ae commit 2eaabf0Copy full SHA for 2eaabf0
octavia/compute/drivers/nova_driver.py
@@ -35,16 +35,17 @@
35
def _extract_amp_image_id_by_tag(client, image_tag):
36
images = list(client.images.list(
37
filters={'tag': [image_tag]},
38
- sort='created_at'))
+ sort='created_at:desc',
39
+ limit=2))
40
if not images:
41
raise exceptions.GlanceNoTaggedImages(tag=image_tag)
- image_id = images[-1]['id']
42
+ image_id = images[0]['id']
43
num_images = len(images)
44
if num_images > 1:
45
LOG.warning(
46
_LW("A single Glance image should be tagged with %(tag)s tag, "
- "but %(num)d found. Using %(image_id)s."),
47
- {'tag': image_tag, 'num': num_images, 'image_id': image_id}
+ "but at least two were found. Using %(image_id)s."),
48
+ {'tag': image_tag, 'image_id': image_id}
49
)
50
return image_id
51
0 commit comments