Revision cda71050 snf-cyclades-app/synnefo/api/util.py
b/snf-cyclades-app/synnefo/api/util.py | ||
---|---|---|
151 | 151 |
"""Return an Image instance or raise ItemNotFound.""" |
152 | 152 |
|
153 | 153 |
with image_backend(user_id) as backend: |
154 |
image = backend.get_image(image_id) |
|
155 |
if not image: |
|
156 |
raise faults.ItemNotFound('Image not found.') |
|
157 |
return image |
|
154 |
return backend.get_image(image_id) |
|
158 | 155 |
|
159 | 156 |
|
160 | 157 |
def get_image_dict(image_id, user_id): |
Also available in: Unified diff