fix check_class_dependency()
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Sat, 5 Oct 2013 13:59:38 +0000 (09:59 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Sat, 5 Oct 2013 13:59:38 +0000 (09:59 -0400)
planetstack/observer/event_loop.py

index 9f3bc5a..482c5a8 100644 (file)
@@ -194,16 +194,17 @@ class PlanetStackObserver:
                                self.last_run_times[e]=0
 
 
-
        def save_run_times(self):
                run_times = json.dumps(self.last_run_times)
                open('/tmp/observer_run_times','w').write(run_times)
 
        def check_class_dependency(self, step, failed_steps):
-               for failed_step in failed_steps:
-                       step.dependencies = self.model_dependency_graph.get(step.provides[0].__name__, [])
-                       if (failed_step in step.dependencies):
-                               raise StepNotReady
+        step.dependenices = []
+        for obj in step.provides:
+            step.dependenices.extend(self.model_dependency_graph.get(obj.__name__, []))
+        for failed_step in failed_steps:
+            if (failed_step in step.dependencies):
+                raise StepNotReady
 
        def run(self):
                if not self.driver.enabled or not self.driver.has_openstack: