From 5a082058e50de2f21776f3a07f15d79c211c10a6 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 11 Oct 2011 10:28:41 +0200 Subject: [PATCH] new method which checks if object exists on the file system Signed-off-by: Steven Armstrong --- lib/cdist/core/object.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/cdist/core/object.py b/lib/cdist/core/object.py index eda7eb40..f3099e1d 100644 --- a/lib/cdist/core/object.py +++ b/lib/cdist/core/object.py @@ -97,3 +97,8 @@ class Object(object): prepared = fsproperty.FileBooleanProperty(lambda obj: os.path.join(obj.absolute_path, "prepared")) ran = fsproperty.FileBooleanProperty(lambda obj: os.path.join(obj.absolute_path, "ran")) source = fsproperty.FileStringProperty(lambda obj: os.path.join(obj.absolute_path, "source")) + + @property + def exists(self): + """Checks wether this cdist object exists on the file systems.""" + return os.path.exists(self.absolute_path)