From: Sapan Bhatia Date: Mon, 4 Aug 2014 14:48:28 +0000 (-0400) Subject: If an object's peer is not set, it implies no dependency. So rather than X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=95470622600c66d3d76aa0ecdacd56559604c175;p=plstackapi.git If an object's peer is not set, it implies no dependency. So rather than failing the dependency check, we pass it. --- diff --git a/planetstack/ec2_observer/syncstep.py b/planetstack/ec2_observer/syncstep.py index dcfea7d..d5f7523 100644 --- a/planetstack/ec2_observer/syncstep.py +++ b/planetstack/ec2_observer/syncstep.py @@ -60,7 +60,10 @@ class SyncStep: for dep in self.dependencies: peer_name = dep[0].lower() + dep[1:] # django names are camelCased with the first letter lower peer_object = getattr(obj, peer_name) - if (peer_object.pk==failed.pk): + + # peer_object can be None, and if so there + # is no object-level dependency + if (peer_object and peer_object.pk==failed.pk): raise FailedDependency def call(self, failed=[], deletion=False):