add some meat to object_run()

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-10 14:45:59 +02:00
parent beafb55e12
commit 636995f44e

View file

@ -372,13 +372,12 @@ class Cdist:
cmd = [] cmd = []
cmd.append("__explorer=" + REMOTE_GLOBAL_EXPLORER_DIR) cmd.append("__explorer=" + REMOTE_GLOBAL_EXPLORER_DIR)
cmd.append("__type_explorer=" + self.remote_type_explorer_dir(type)) cmd.append("__type_explorer=" + self.remote_type_explorer_dir(type))
cmd.append("__global =" + self.out_dir) cmd.append("__object=" + self.remote_object_dir(cdist_object))
cmd.append("__object_id=" + self.get_object_id_from_object(cdist_object)) cmd.append("__object_id=" + self.get_object_id_from_object(cdist_object))
cmd.append("__object_fq=" + cdist_object) cmd.append("__object_fq=" + cdist_object)
# Need to transfer at least the parameters for objects to be useful # Need to transfer at least the parameters for objects to be useful
self.transfer_object_parameter(cdist_object) self.transfer_object_parameter(cdist_object)
cmd.append("__object=" + self.remote_object_dir(cdist_object))
explorers = self.list_type_explorers(type) explorers = self.list_type_explorers(type)
for explorer in explorers: for explorer in explorers:
@ -460,10 +459,10 @@ class Cdist:
def object_run(self, cdist_object, mode): def object_run(self, cdist_object, mode):
"""Run gencode or code for an object""" """Run gencode or code for an object"""
# FIXME: Check requirements and execute those before # FIXME: Check requirements and execute those before
requirements = list_object_requirements(cdist_object) requirements = self.list_object_requirements(cdist_object)
for requirement in requirements: for requirement in requirements:
object_run(requirement, mode=mode) self.object_run(requirement, mode=mode)
# Find and run all available gencode scripts # Find and run all available gencode scripts
if mode == "gencode": if mode == "gencode":
@ -476,6 +475,7 @@ class Cdist:
# cdist-object-code-run "$__cdist_target_host" "$__cdist_object_self" # cdist-object-code-run "$__cdist_target_host" "$__cdist_object_self"
for bin in paths: for bin in paths:
FIXME
if os.path.isfile(bin): if os.path.isfile(bin):
if mode == "gencode": if mode == "gencode":
self.shell_run_or_debug_fail(manifest, [manifest], env=env) self.shell_run_or_debug_fail(manifest, [manifest], env=env)
@ -506,11 +506,8 @@ class Cdist:
# Now do the final steps over the existing objects # Now do the final steps over the existing objects
for cdist_object in objects: for cdist_object in objects:
object_run(cdist_object, mode="gencode") self.object_run(cdist_object, mode="gencode")
object_run(cdist_object, mode="code") self.object_run(cdist_object, mode="code")
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(description='cdist ' + VERSION) parser = argparse.ArgumentParser(description='cdist ' + VERSION)