Provide default implementation of fetch_pending to remove redundant code
from steps.
diff --git a/planetstack/openstack_observer/syncstep.py b/planetstack/openstack_observer/syncstep.py
index fc0cb0b..dcfea7d 100644
--- a/planetstack/openstack_observer/syncstep.py
+++ b/planetstack/openstack_observer/syncstep.py
@@ -44,7 +44,16 @@
return
def fetch_pending(self, deletion=False):
- return []
+ # This is the most common implementation of fetch_pending
+ # Steps should override it if they have their own logic
+ # for figuring out what objects are outstanding.
+ main_obj = self.provides[0]
+ if (not deleted):
+ objs = main_obj.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+ else:
+ objs = main_obj.deleted_objects.all()
+
+ return objs
#return Sliver.objects.filter(ip=None)
def check_dependencies(self, obj, failed):