diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-08-25 21:56:45 +0000 |
|---|---|---|
| committer | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-08-25 21:56:45 +0000 |
| commit | 2cf0b67e08e1608bd717ffadd41d5029db2b4a3a (patch) | |
| tree | a7c0e4f75391220ce906c20a72ece22e96b31b94 /nova/image | |
| parent | 847d6aecb64d7abece4d4f426f26a9561ffb1e51 (diff) | |
Fix glance image authorization check now that glance can do authorization checks on its own; use correct image service when looking for ramdisk, etc.; fix a couple of PEP8 errors
Diffstat (limited to 'nova/image')
| -rw-r--r-- | nova/image/glance.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nova/image/glance.py b/nova/image/glance.py index 9060f6a91..16f803218 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -269,6 +269,20 @@ class GlanceImageService(service.BaseImageService): image_meta = _convert_from_string(image_meta) return image_meta + @staticmethod + def _is_image_available(context, image_meta): + """Check image availability. + + Under Glance, images are always available if the context has + an auth_token. Otherwise, we fall back to the superclass + method. + + """ + if hasattr(context, 'auth_token') and context.auth_token: + return True + return service.BaseImageService._is_image_available(context, + image_meta) + # utility functions def _convert_timestamps_to_datetimes(image_meta): |
