argc == 1 for cdist-object-gencode-all

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-18 00:22:02 +01:00
parent 82cac6f3d8
commit 7e713f1b22
2 changed files with 5 additions and 12 deletions

View file

@ -50,9 +50,7 @@ cdist-explorer-run-global "$__cdist_target_host"
cdist-manifest-run-init "$__cdist_target_host"
cdist-manifest-run-all "$__cdist_target_host"
cdist-object-explorer-all "$__cdist_target_host"
# Generate code for all objects
cdist-object-gencode-all "$__cdist_target_host" "$__cdist_out_object_dir"
cdist-object-gencode-all "$__cdist_target_host"
# Transfer all objects including code
cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \

View file

@ -18,29 +18,24 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
#
# For each created object create the code to be executed on the
# target.
# For each created object create the code to be executed on the target.
#
. cdist-config
if [ $# -ne 2 ]; then
__cdist_usage "<target host> <object_base_dir>"
fi
[ $# -eq 1 ] || __cdist_usage "<target host>"
set -eu
__cdist_target_host="$1"; shift
__cdist_object_base_dir="$1"; shift
__cdist_object_list "$__cdist_object_base_dir" > "$__cdist_tmp_file"
__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file"
while read object; do
code="$(__cdist_object_code "$object")"
echo "Generating code for $object ..."
cdist-object-gencode "$__cdist_target_host" \
"$__cdist_object_base_dir" \
"$__cdist_out_object_dir" \
"$object" > "${code}"
chmod u+x "${code}"