From 79d0a18bb24aea5a19d9c034b74db1e9441a8a0e Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 7 Oct 2011 16:12:01 +0200 Subject: [PATCH] use absolute path for accessing file system Signed-off-by: Steven Armstrong --- lib/cdist/core/object.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/cdist/core/object.py b/lib/cdist/core/object.py index 76f37487..f5179606 100644 --- a/lib/cdist/core/object.py +++ b/lib/cdist/core/object.py @@ -126,12 +126,12 @@ class Object(object): @property def changed(self): """Check whether the object has been changed.""" - return os.path.isfile(os.path.join(self.path, "changed")) + return os.path.isfile(os.path.join(self.absolute_path, "changed")) @changed.setter def changed(self, value): """Change the objects changed status.""" - path = os.path.join(self.path, "changed") + path = os.path.join(self.absolute_path, "changed") if value: open(path, "w").close() else: @@ -147,12 +147,12 @@ class Object(object): @property def prepared(self): """Check whether the object has been prepared.""" - return os.path.isfile(os.path.join(self.path, "prepared")) + return os.path.isfile(os.path.join(self.absolute_path, "prepared")) @prepared.setter def prepared(self, value): """Change the objects prepared status.""" - path = os.path.join(self.path, "prepared") + path = os.path.join(self.absolute_path, "prepared") if value: open(path, "w").close() else: @@ -168,12 +168,12 @@ class Object(object): @property def ran(self): """Check whether the object has been ran.""" - return os.path.isfile(os.path.join(self.path, "ran")) + return os.path.isfile(os.path.join(self.absolute_path, "ran")) @ran.setter def ran(self, value): """Change the objects ran status.""" - path = os.path.join(self.path, "ran") + path = os.path.join(self.absolute_path, "ran") if value: open(path, "w").close() else: