From 79d0a18bb24aea5a19d9c034b74db1e9441a8a0e Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 7 Oct 2011 16:12:01 +0200 Subject: [PATCH 1/3] 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: From 22784f447d1f60edb11c588be5dc79cd291df5e3 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 7 Oct 2011 16:43:05 +0200 Subject: [PATCH 2/3] --todo Signed-off-by: Steven Armstrong --- doc/dev/todo/steven | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/dev/todo/steven b/doc/dev/todo/steven index 54b43210..47e0f6e7 100644 --- a/doc/dev/todo/steven +++ b/doc/dev/todo/steven @@ -1,11 +1,4 @@ Object: - cdist_object.code_local_path - cdist_object.code_remote_path - cdist_object.remote_code_remote_path - - cdist_object.parameter_path - - Type: From 53737aad3a0e83a74ea7150f1210844ca0850bda Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 7 Oct 2011 16:46:55 +0200 Subject: [PATCH 3/3] append .cdist to absolute paths Signed-off-by: Steven Armstrong --- lib/cdist/core/object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cdist/core/object.py b/lib/cdist/core/object.py index f5179606..2f1d93c4 100644 --- a/lib/cdist/core/object.py +++ b/lib/cdist/core/object.py @@ -69,7 +69,7 @@ class Object(object): self.object_id = object_id self.name = os.path.join(self.type.name, self.object_id) self.path = os.path.join(self.type.path, self.object_id) - self.absolute_path = os.path.join(self.base_path, self.path) + self.absolute_path = os.path.join(self.base_path, self.path, DOT_CDIST) self.code_local_path = os.path.join(self.path, "code-local") self.code_remote_path = os.path.join(self.path, "code-remote") self.parameter_path = os.path.join(self.path, "parameter")