summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-06-23 16:17:54 -0500
committerJosh Kearney <josh@jk0.org>2011-06-23 16:17:54 -0500
commit2028222a5ed47dc82b49f51969d237c4eece50e7 (patch)
tree9e6ba7c1496715fd0deb580cef198809b497b0fd
parent63a9216ecbaab20fc7dfb82afb9fe0e2f3fbded4 (diff)
downloadnova-2028222a5ed47dc82b49f51969d237c4eece50e7.tar.gz
nova-2028222a5ed47dc82b49f51969d237c4eece50e7.tar.xz
nova-2028222a5ed47dc82b49f51969d237c4eece50e7.zip
Fixed filter property and added logging.
-rw-r--r--nova/compute/manager.py7
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