Refactored the sync_volume step with new style of deletion
diff --git a/planetstack/syndicate_observer/steps/sync_volume.py b/planetstack/syndicate_observer/steps/sync_volume.py
index 767541c..7ee395c 100644
--- a/planetstack/syndicate_observer/steps/sync_volume.py
+++ b/planetstack/syndicate_observer/steps/sync_volume.py
@@ -48,14 +48,6 @@
def __init__(self, **args):
SyncStep.__init__(self, **args)
- def fetch_pending(self):
- try:
- ret = Volume.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
- return ret
- except Exception, e:
- traceback.print_exc()
- return None
-
def sync_record(self, volume):
"""
Synchronize a Volume record with Syndicate.
@@ -110,6 +102,16 @@
raise e
return True
+
+ def delete_record(self, volume):
+ try:
+ volume_name = volume.name
+ syndicatelib.ensure_volume_absent( volume_name )
+ except Exception, e:
+ traceback.print_exc()
+ logger.exception("Failed to erase volume '%s'" % volume_name)
+ raise e
+