implement Object state

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/feature_files_export
Steven Armstrong 13 years ago
parent 4f398a834f
commit 022b17d700
  1. 6
      lib/cdist/core/object.py

@ -51,6 +51,11 @@ class Object(object):
"""
# Constants for use with Object.state
STATE_PREPARED = "prepared"
STATE_RUNNING = "running"
STATE_DONE = "done"
@classmethod
def list_objects(cls, object_base_path, type_base_path):
"""Return a list of object instances"""
@ -127,6 +132,7 @@ class Object(object):
changed = fsproperty.FileBooleanProperty(lambda obj: os.path.join(obj.absolute_path, "changed"))
prepared = fsproperty.FileBooleanProperty(lambda obj: os.path.join(obj.absolute_path, "prepared"))
ran = fsproperty.FileBooleanProperty(lambda obj: os.path.join(obj.absolute_path, "ran"))
state = fsproperty.FileStringProperty(lambda obj: os.path.join(obj.absolute_path, "state"))
source = fsproperty.FileListProperty(lambda obj: os.path.join(obj.absolute_path, "source"))
code_local = fsproperty.FileStringProperty(lambda obj: os.path.join(obj.base_path, obj.code_local_path))
code_remote = fsproperty.FileStringProperty(lambda obj: os.path.join(obj.base_path, obj.code_remote_path))

Loading…
Cancel
Save