From ea39e137f3986019b276d6e11b6b50e698544ac3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Feb 2011 01:06:02 +0100 Subject: [PATCH] re-integrate cdist-object-codegen-all Signed-off-by: Nico Schottelius --- bin/cdist-config | 5 +++++ bin/cdist-deploy-to | 6 ++++-- bin/cdist-object-codegen-all | 12 ++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 16aef65b..372aa2d7 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -193,6 +193,11 @@ __cdist_remote_object_dir() echo "${__cdist_remote_out_object_base_dir}/$1" } +__cdist_object_code() +{ + echo "$(__cdist_object_dir "$1")/${__cdist_name_code}" +} + __cdist_object_parameter_dir() { echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}" diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index b0b70220..f8b5553a 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -55,9 +55,11 @@ cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir" # Run explorer of each type for every object of types with explorer cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir" -exit 2 +# Generate code for all objects +cdist-object-codegen-all "$__cdist_target_host" "$__cdist_out_object_dir" \ + "$__cdist_out_code_dir" -cdist-object-codegen-all "$__cdist_target_host" "$__cdist_out_object_dir" "$__cdist_out_execs" +exit 2 cdist-exec-transfer "$__cdist_target_host" "$__cdist_out_execs" cdist-exec-run "$__cdist_target_host" diff --git a/bin/cdist-object-codegen-all b/bin/cdist-object-codegen-all index 2e7a5bab..98d4d9e0 100755 --- a/bin/cdist-object-codegen-all +++ b/bin/cdist-object-codegen-all @@ -25,26 +25,22 @@ . cdist-config if [ $# -ne 3 ]; then - __cdist_usage " " + __cdist_usage " " fi set -eu __cdist_target_host="$1"; shift __cdist_object_base_dir="$1"; shift -__cdist_exec_dir="$1"; shift __cdist_object_list "$__cdist_object_base_dir" > "$__cdist_tmp_file" while read object; do - outdir="$__cdist_exec_dir/${object}" - outfile="${outdir}/${__cdist_name_exec}" - - mkdir -p "${outdir}" + code="$(__cdist_object_code "$object")" cdist-object-codegen "$__cdist_target_host" \ "$__cdist_object_base_dir" \ - "$object" > "${outfile}" + "$object" > "${code}" - chmod u+x "${outfile}" + chmod u+x "${code}" done < "$__cdist_tmp_file"