update cdist-explorer-run to almost run again

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-23 16:49:39 +01:00
parent 995bf8d963
commit 9c9d3b33cf
3 changed files with 4 additions and 39 deletions

View File

@ -36,11 +36,11 @@ cdist-dir push "$__cdist_target_host" "${__cdist_helper_dir}" "${__cdist_remote_
scp "$(which cdist-config)" \
"${__cdist_remote_user}@${__cdist_target_host}:${__cdist_remote_helper_dir}"
exit 2
# Execute explorer
cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir"
exit 2
cdist-manifest-init "$__cdist_target_host" "$__cdist_out_object_dir"
cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir"
cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir"

View File

@ -30,42 +30,6 @@ fi
set -ue
__cdist_target_host="$1"; shift
__cdist_remote_src_dir="$1"; shift
__cdist_remote_dst_dir="$1"; shift
# Create remote destination directory
ssh "${__cdist_remote_user}@${__cdist_target_host}" \
"mkdir -p \"${__cdist_remote_dst_dir}\""
# FIXME: enable -q as soon as the code is cleaned up
cd "${__cdist_local_src_dir}"
# Ensure there is at least one explorer
num="$(ls -1 | wc -l)"
if [ "$num" -lt 1 ]; then
__cdist_exit_err "${__cdist_local_src_dir}: Contains no explorers"
fi
# Execute all explorers
for explorer in *; do
if [ -f "$explorer" ]; then
if [ ! -x "$explorer" ]; then
echo "Explorer \"$explorer\" exists, but is not executable."
continue
fi
# Execute explorers and save results in remote destination directory
ssh "${__cdist_remote_user}@${__cdist_target_host}" \
"cd \"${__cdist_remote_src_dir}\" && \"./$explorer\" > \
\"${__cdist_remote_dst_dir}/${explorer}\"" "$@"
else
if [ -e "$explorer" ]; then
echo "Explorer \"$explorer\" exists, but is not a file."
continue
fi
fi
done
# Copy results back to us
scp "${__cdist_remote_user}@${__cdist_target_host}:${__cdist_remote_dst_dir}/*" \
"$__cdist_local_dst_dir"
"${__cdist_remote_helper_dir}/cdist-explorer-remote-run" "$@"

View File

@ -35,6 +35,7 @@ __cdist_explorer_dir="$1"; shift
__cdist_my_out_dir="$1"; shift
cd "${__cdist_work_dir}"
mkdir -p "$__cdist_my_out_dir"
# Ensure there is at least one explorer
num="$(ls -1 "$__cdist_explorer_dir" | wc -l)"