add some meat to object_run()

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/feature_files_export
Nico Schottelius 13 years ago
parent beafb55e12
commit 636995f44e
  1. 15
      bin/cdist

@ -372,13 +372,12 @@ class Cdist:
cmd = []
cmd.append("__explorer=" + REMOTE_GLOBAL_EXPLORER_DIR)
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_fq=" + cdist_object)
# Need to transfer at least the parameters for objects to be useful
self.transfer_object_parameter(cdist_object)
cmd.append("__object=" + self.remote_object_dir(cdist_object))
explorers = self.list_type_explorers(type)
for explorer in explorers:
@ -460,10 +459,10 @@ class Cdist:
def object_run(self, cdist_object, mode):
"""Run gencode or code for an object"""
# FIXME: Check requirements and execute those before
requirements = list_object_requirements(cdist_object)
requirements = self.list_object_requirements(cdist_object)
for requirement in requirements:
object_run(requirement, mode=mode)
self.object_run(requirement, mode=mode)
# Find and run all available gencode scripts
if mode == "gencode":
@ -476,6 +475,7 @@ class Cdist:
# cdist-object-code-run "$__cdist_target_host" "$__cdist_object_self"
for bin in paths:
FIXME
if os.path.isfile(bin):
if mode == "gencode":
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
for cdist_object in objects:
object_run(cdist_object, mode="gencode")
object_run(cdist_object, mode="code")
self.object_run(cdist_object, mode="gencode")
self.object_run(cdist_object, mode="code")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='cdist ' + VERSION)

Loading…
Cancel
Save