diff options
| author | Josh Kearney <josh@jk0.org> | 2011-06-23 16:17:54 -0500 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2011-06-23 16:17:54 -0500 |
| commit | 2028222a5ed47dc82b49f51969d237c4eece50e7 (patch) | |
| tree | 9e6ba7c1496715fd0deb580cef198809b497b0fd | |
| parent | 63a9216ecbaab20fc7dfb82afb9fe0e2f3fbded4 (diff) | |
| download | nova-2028222a5ed47dc82b49f51969d237c4eece50e7.tar.gz nova-2028222a5ed47dc82b49f51969d237c4eece50e7.tar.xz nova-2028222a5ed47dc82b49f51969d237c4eece50e7.zip | |
Fixed filter property and added logging.
| -rw-r--r-- | nova/compute/manager.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 3c849286e..d0ca1ff0d 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -524,9 +524,10 @@ class ComputeManager(manager.SchedulerDependentManager): None if rotation shouldn't be used (as in the case of snapshots) """ image_service = nova.image.get_default_image_service() - filters = {'property-image-type': image_type, - 'property-instance-uuid': instance_uuid} + filters = {'property-image_type': image_type, + 'property-instance_uuid': instance_uuid} images = image_service.detail(context, filters=filters) + LOG.debug(_("Found %d images (rotation: %d)" % (len(images), rotation))) if len(images) > rotation: # Sort oldest (by created_at) to end of list images.sort(key=itemgetter('created_at'), reverse=True) @@ -534,9 +535,11 @@ class ComputeManager(manager.SchedulerDependentManager): # NOTE(sirp): this deletes all backups that exceed the rotation # limit excess = len(images) - rotation + LOG.debug(_("Rotating out %d backups" % excess)) for i in xrange(excess): image = images.pop() image_id = image['id'] + LOG.debug(_("Deleting image %d" % image_id)) image_service.delete(context, image_id) @exception.wrap_exception |
