=== modified file 'bin/confz' --- bin/confz 2014-06-19 19:03:09 +0000 +++ bin/confz 2014-06-19 18:45:05 +0000 @@ -7,7 +7,7 @@ typeset -gA vars vars_prev typeset -ga do_command -typeset -g confz_indent check_only verbose fail_reason +typeset -g confz_indent check_only verbose : ${check_only:=0} : ${verbose:=0} @@ -128,9 +128,6 @@ do_command_prev=( "${do_command[@]}" ) do_command=( confz_${name}_do ) - # clear fail_reason - fail_reason='' - # perform check - run - check if confz_${name}_check "$@"; then confz_check_ok $name @@ -145,21 +142,17 @@ # confz_${name}_check # set -x # fi - die "$name: check failed with error $check_ret" $fail_reason + die "$name: check failed with error $check_ret" else confz_do "${do_command[@]}" "$@" # print check start confz_check_start $name "$@" ...again - # clear fail_reason - fail_reason='' - # perform check once again check_only_prev=$check_only check_only=1 - confz_${name}_check "$@" || \ - die "$name: check failed with error $?" $fail_reason + confz_${name}_check "$@" || die "$name: check failed with error $?" confz_check_ok $name check_only=$check_only_prev fi === modified file 'zsh-functions/confz_fs_init' --- zsh-functions/confz_fs_init 2014-06-19 19:03:09 +0000 +++ zsh-functions/confz_fs_init 2014-06-19 18:05:11 +0000 @@ -26,7 +26,6 @@ ${vars[vg_name]} ) - fail_reason="not a block device: ${vars[device]}" [[ -b ${vars[device]} ]] } @@ -59,7 +58,6 @@ tries=$[$tries - 1] done - fail_reason="no blkid signature found on $vars[device]" [[ -z $blk_out ]] && return 1 # nothing found on the device eval $blk_out [[ $LABEL == ${vars[label]} && $TYPE == xfs ]] && return 0 @@ -101,13 +99,11 @@ return 0 # found matching entry fi done - - fail_reason="no entry for ${(qqq)vars[mountpoint]} in /etc/fstab" return 1 # did not find matching entry } confz_fstab_do() { - print -r - >>/etc/fstab ${vars[device]}$'\t'${vars[mountpoint]}$'\t'${vars[filesystem]}$'\t'${vars[opts]}$'\t'${vars[dump]}' '${vars[pass]} + print -r - >>/etc/fstab "${vars[device]} ${vars[mountpoint]} ${vars[filesystem]} ${vars[opts]} ${vars[dump]} ${vars[pass]}" } @@ -115,7 +111,6 @@ confz_mounted_check() { checkvars device mountpoint - fail_reason="could not find ${vars[device]} ${vars[mountpoint]} in /proc/mounts" grep -q "^${vars[device]} ${vars[mountpoint]} " /proc/mounts } === modified file 'zsh-functions/confz_vserver_init' --- zsh-functions/confz_vserver_init 2014-06-19 19:03:09 +0000 +++ zsh-functions/confz_vserver_init 2014-06-19 18:43:29 +0000 @@ -15,7 +15,6 @@ do_command=( tar -pC ${vars[path]} -f ${vars[source]} ) fi - fail_reason="${vars[path]}/bin missing" [[ -e ${vars[path]}/bin ]] } @@ -29,6 +28,7 @@ setvar vdir /vservers/${vars[name]} local ctx ret + ret=1 if [[ -e ${vars[etcdir]}/context ]]; then if [[ $(<${vars[etcdir]}/context) == ${vars[context_id]} ]]; then @@ -38,18 +38,13 @@ "has context different from ${(qqq)vars[context_id]}" fi else - ret=1 - fail_reason="$(<${vars[etcdir]}/context) missing" for ctx in /etc/vservers/*/context; do if [[ $(<$ctx) == ${vars[context_id]} ]]; then die "$0: context id already used by $ctx" fi done fi - if ! [[ -h ${vars[etcdir]}/vdir ]]; then - fail_reason="${vars[etcdir]}/vdir missing" - ret=1 - fi + [[ -h ${vars[etcdir]}/vdir ]] || ret=1 require mounted_volume :size :filesystem \ lv_name=vs_$vars[name] \