From c58ec7e4efbf700309c60277baf8a3c91c408a09 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 3 Nov 2011 00:25:06 +0100 Subject: [PATCH] prevent circular dependencies Signed-off-by: Steven Armstrong --- lib/cdist/emulator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cdist/emulator.py b/lib/cdist/emulator.py index 5b842a91..481e734a 100644 --- a/lib/cdist/emulator.py +++ b/lib/cdist/emulator.py @@ -187,4 +187,6 @@ class Emulator(object): __object_name = os.environ.get('__object_name', None) if __object_name: _object = self.cdist_object.object_from_name(__object_name) - _object.requirements.append(self.cdist_object.name) + # prevent circular dependencies + if not _object.name in self.cdist_object.requirements: + _object.requirements.append(self.cdist_object.name)