From bfae291cf797da1bb9ce653398aea826bc2f3535 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 17 Sep 2013 22:41:10 +0200 Subject: [PATCH] remove pseudo debug output redirection Signed-off-by: Steven Armstrong --- cdist/conf/type/__install_mkfs/gencode-remote | 20 +----------------- .../conf/type/__install_mount/gencode-remote | 21 +------------------ .../gencode-remote | 18 +--------------- .../conf/type/__install_stage/gencode-remote | 18 ---------------- 4 files changed, 3 insertions(+), 74 deletions(-) diff --git a/cdist/conf/type/__install_mkfs/gencode-remote b/cdist/conf/type/__install_mkfs/gencode-remote index 6a71b8ed..2fe680e5 100755 --- a/cdist/conf/type/__install_mkfs/gencode-remote +++ b/cdist/conf/type/__install_mkfs/gencode-remote @@ -1,6 +1,6 @@ #!/bin/sh # -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# 2011-2013 Steven Armstrong (steven-cdist at armstrong.cc) # # This file is part of cdist. # @@ -21,17 +21,6 @@ device="$(cat "$__object/parameter/device")" type="$(cat "$__object/parameter/type")" -# show command output in debug mode -cat << DONE -__debug=$__cdist_debug -if [ "\$__debug" != "yes" ]; then - # Link file descriptor #6 with stdout - exec 6>&1 - # redirect all output to /dev/null - exec > /dev/null -fi -DONE - case "$type" in swap) echo "mkswap $device" @@ -62,10 +51,3 @@ case "$type" in fi echo "$command" esac - -cat << DONE -if [ "\$__debug" != "yes" ]; then - # Restore stdout and close file descriptor #6. - exec 1>&6 6>&- -fi -DONE diff --git a/cdist/conf/type/__install_mount/gencode-remote b/cdist/conf/type/__install_mount/gencode-remote index 0ab5c069..3a35c139 100755 --- a/cdist/conf/type/__install_mount/gencode-remote +++ b/cdist/conf/type/__install_mount/gencode-remote @@ -1,6 +1,6 @@ #!/bin/sh # -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# 2011-2013 Steven Armstrong (steven-cdist at armstrong.cc) # # This file is part of cdist. # @@ -18,18 +18,6 @@ # along with cdist. If not, see . # -# show command output in debug mode -cat << DONE -__debug=$__cdist_debug -if [ "\$__debug" != "yes" ]; then - # Link file descriptor #6 with stdout - exec 6>&1 - # redirect all output to /dev/null - exec > /dev/null -fi -DONE - - get_type_from_mkfs() { _device="$1" for mkfs_object in $(find "$__global/object/__install_mkfs" -path "*.cdist"); do @@ -69,10 +57,3 @@ else echo "[ -d \"$mount_point\" ] || mkdir -p \"$mount_point\"" echo "mount -t \"$type\" $options \"$device\" \"$mount_point\"" fi - -cat << DONE -if [ "\$__debug" != "yes" ]; then - # Restore stdout and close file descriptor #6. - exec 1>&6 6>&- -fi -DONE diff --git a/cdist/conf/type/__install_partition_msdos_apply/gencode-remote b/cdist/conf/type/__install_partition_msdos_apply/gencode-remote index c683673d..a1547296 100755 --- a/cdist/conf/type/__install_partition_msdos_apply/gencode-remote +++ b/cdist/conf/type/__install_partition_msdos_apply/gencode-remote @@ -1,6 +1,6 @@ #!/bin/sh # -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# 2011-2013 Steven Armstrong (steven-cdist at armstrong.cc) # # This file is part of cdist. # @@ -71,15 +71,6 @@ get_objects() { } # include function library for use on target -cat << DONE -__debug=$__cdist_debug -if [ "\$__debug" != "yes" ]; then - # Link file descriptor #6 with stdout - exec 6>&1 - # redirect all output to /dev/null - exec > /dev/null -fi -DONE cat "$__type/files/lib.sh" partitions="$__object/explorer/partitions" @@ -166,10 +157,3 @@ for object in $objects; do echo "toggle_bootable '$device' '$minor' || die 'Failed to toogle bootable flag for partition: $partition'" fi done - -cat << DONE -if [ "\$__debug" != "yes" ]; then - # Restore stdout and close file descriptor #6. - exec 1>&6 6>&- -fi -DONE diff --git a/cdist/conf/type/__install_stage/gencode-remote b/cdist/conf/type/__install_stage/gencode-remote index 12b9f1ed..bbc27679 100755 --- a/cdist/conf/type/__install_stage/gencode-remote +++ b/cdist/conf/type/__install_stage/gencode-remote @@ -18,17 +18,6 @@ # along with cdist. If not, see . # -# show command output in debug mode -cat << DONE -__debug=$__cdist_debug -if [ "\$__debug" != "yes" ]; then - # Link file descriptor #6 with stdout - exec 6>&1 - # redirect all output to /dev/null - exec > /dev/null -fi -DONE - uri="$(cat "$__object/parameter/uri" 2>/dev/null \ || echo "$__object_id")" target="$(cat "$__object/parameter/target")" @@ -38,10 +27,3 @@ target="$(cat "$__object/parameter/target")" [ "$__debug" = "yes" ] && tar="tar -xvzp" || tar="tar -xzp" echo "$curl '$uri' | $tar -C '$target'" - -cat << DONE -if [ "\$__debug" != "yes" ]; then - # Restore stdout and close file descriptor #6. - exec 1>&6 6>&- -fi -DONE