forked from ungleich-public/cdist
successfully run remote code!
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
5c35cad477
commit
f6fac37f1d
2 changed files with 10 additions and 1 deletions
|
@ -274,6 +274,13 @@ __cdist_remote_object_dir()
|
||||||
echo "$(__cdist_remote_object_base_dir "$1")/${__cdist_name_dot_cdist}"
|
echo "$(__cdist_remote_object_base_dir "$1")/${__cdist_name_dot_cdist}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__cdist_remote_object_code()
|
||||||
|
{
|
||||||
|
# FIXME: this should probably be __cdist_name_CODE_remote instead, although
|
||||||
|
# they have the same name always
|
||||||
|
echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_code}-${__cdist_name_gencode_remote}"
|
||||||
|
}
|
||||||
|
|
||||||
__cdist_remote_object_parameter_dir()
|
__cdist_remote_object_parameter_dir()
|
||||||
{
|
{
|
||||||
echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}"
|
echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}"
|
||||||
|
|
|
@ -26,7 +26,7 @@ __cdist_object_code_run()
|
||||||
{
|
{
|
||||||
[ $# -eq 1 ] || __cdist_exit_err "<object>"
|
[ $# -eq 1 ] || __cdist_exit_err "<object>"
|
||||||
|
|
||||||
set -x
|
# set -x
|
||||||
|
|
||||||
if [ ! -d "$(__cdist_object_dir "$1")" ]; then
|
if [ ! -d "$(__cdist_object_dir "$1")" ]; then
|
||||||
__cdist_exit_err "Object undefined"
|
__cdist_exit_err "Object undefined"
|
||||||
|
@ -44,5 +44,7 @@ __cdist_object_code_run()
|
||||||
if __cdist_is_executable \
|
if __cdist_is_executable \
|
||||||
"$(__cdist_object_code "$1" "${__cdist_name_gencode_remote}")"; then
|
"$(__cdist_object_code "$1" "${__cdist_name_gencode_remote}")"; then
|
||||||
|
|
||||||
|
__cdist_run_remote $(__cdist_remote_object_code "$1")
|
||||||
fi
|
fi
|
||||||
|
# set +x
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue