From 8d774ff152f8039dd494442de549e55bddb82ec2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Feb 2011 00:54:49 +0100 Subject: [PATCH] fix some issues in cdist-config, transfer parameters Signed-off-by: Nico Schottelius --- bin/cdist-config | 24 +++++++++++++++++------- bin/cdist-object-explorer-all | 12 ++++++++---- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index da7281c2..16aef65b 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -183,24 +183,34 @@ __cdist_object_id_from_object() echo "${1#*/}" } -__cdist_object_param_dir() +__cdist_object_dir() { - echo "${__cdist_object_base_dir}/$1/$__cdist_name_parameter}" + echo "${__cdist_object_base_dir}/$1" } -__cdist_object_type_explorer_dir() +__cdist_remote_object_dir() { - echo "${__cdist_object_base_dir}/$1/${__cdist_name_explorer}" + echo "${__cdist_remote_out_object_base_dir}/$1" } -__cdist_remote_object_type_explorer_dir() +__cdist_object_parameter_dir() { - echo "${__cdist_remote_out_object_base_dir}/$1/${__cdist_name_explorer}" + echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}" } __cdist_remote_object_parameter_dir() { - echo "${__cdist_remote_out_object_base_dir}/$1/${__cdist_name_parameter}" + echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}" +} + +__cdist_object_type_explorer_dir() +{ + echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" +} + +__cdist_remote_object_type_explorer_dir() +{ + echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_explorer}" } # Find objects, remove ./ and /MARKER diff --git a/bin/cdist-object-explorer-all b/bin/cdist-object-explorer-all index e38dc070..8d6ab54a 100755 --- a/bin/cdist-object-explorer-all +++ b/bin/cdist-object-explorer-all @@ -75,17 +75,21 @@ while [ $# -gt 0 ]; do __object_id="$(__cdist_object_id_from_object "$__object")" __cdist_type="$(__cdist_type_from_object "$__object")" - # Always copy object parameters (looks weired if done only for the ones with explorer) - # Really always? - # Check if type of object has >= 1 explorer has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" # If so, run explorers on remote side if [ "$has_explorer" ]; then echo "Running explorers for $__object ..." + # Copy object parameters + cdist-dir push "$__cdist_target_host" \ + "$(__cdist_object_parameter_dir "$__object")" \ + "$(__cdist_remote_object_parameter_dir "$__object")" + + # Execute explorers cdist-run-remote "$__cdist_target_host" \ - "__object=\"$__object\" __object_id=\"$__object_id\"" \ + "__object=\"$(__cdist_remote_object_dir "$__object")\"" \ + "__object_id=\"$__object_id\"" \ cdist-remote-explorer-run \ "$__cdist_name_var_type_explorer" \ "$(__cdist_remote_type_explorer_dir "$__cdist_type")" \