fix bugs
diff --git a/planetstack/observer/event_loop.py b/planetstack/observer/event_loop.py
index f71ca00..7ad3efc 100644
--- a/planetstack/observer/event_loop.py
+++ b/planetstack/observer/event_loop.py
@@ -190,8 +190,8 @@
def check_class_dependency(self, step, failed_steps):
for failed_step in failed_steps:
- dependencies = self.model_dependency_graph.get(step.provides[0].__name__, [])
- if (failed_step in dependencies):
+ step.dependencies = self.model_dependency_graph.get(step.provides[0].__name__, [])
+ if (failed_step in step.dependencies):
raise StepNotReady
def run(self):
diff --git a/planetstack/observer/syncstep.py b/planetstack/observer/syncstep.py
index 0cdcf13..0772b4c 100644
--- a/planetstack/observer/syncstep.py
+++ b/planetstack/observer/syncstep.py
@@ -1,5 +1,6 @@
import os
import base64
+from datetime import datetime
from planetstack.config import Config
class FailedDependency(Exception):
@@ -42,7 +43,7 @@
def check_dependencies(self, obj):
for dep in self.dependencies:
- peer_object = getattr(obj, dep.name.lowercase())
+ peer_object = getattr(obj, dep.lower())
if (peer_object.pk==dep.pk):
raise DependencyFailed
@@ -50,7 +51,7 @@
pending = self.fetch_pending()
for o in pending:
try:
- check_dependencies(o) # Raises exception if failed
+ self.check_dependencies(o) # Raises exception if failed
self.sync_record(o)
o.enacted = datetime.now() # Is this the same timezone? XXX
o.save(update_fields=['enacted'])