diff options
Diffstat (limited to 'deploy/post/glance.py')
-rw-r--r-- | deploy/post/glance.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/deploy/post/glance.py b/deploy/post/glance.py index 7ea4b51d..4171c8a8 100644 --- a/deploy/post/glance.py +++ b/deploy/post/glance.py @@ -10,6 +10,7 @@ import os import glanceclient +from deploy.common import query import keystoneauth @@ -35,11 +36,7 @@ class Glance(keystoneauth.Keystoneauth): return id def get_by_name(self, name): - for image in self.list(): - if image.name == name: - return image.id - - return None + return query.find(lambda image: image.name == name, self.list()) def list(self): return self.controller.list() |