Change to a list comprehesion

This commit is contained in:
Joseph Schorr 2014-01-07 15:48:44 -05:00
parent 971dd7dd3a
commit bd2fe5cf99

View file

@ -769,10 +769,7 @@ def delete_tag_and_images(namespace_name, repository_name, tag_name):
tag_image_ids.discard(str(tag.image.id))
# Find all the images that belong to the tag.
tag_images = []
for image in all_images:
if str(image.id) in tag_image_ids:
tag_images.append(image)
tag_images = [image for image in all_images if str(image.id) in tag_image_ids]
# Delete the tag found.
found_tag.delete_instance()