Skip to content

Commit 5232d68

Browse files
authored
Merge pull request #33 from stackhpc/bugfix/config-diff-verbosity
Add guards around backing up ANSIBLE_VERBOSITY
2 parents d9d1790 + a576a8b commit 5232d68

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/config-diff.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ function post_config_init {
6161
}
6262

6363
function redact_file {
64-
_ANSIBLE_VERBOSITY=$ANSIBLE_VERBOSITY
64+
if [ ! -z ${ANSIBLE_VERBOSITY:+x} ]; then
65+
_ANSIBLE_VERBOSITY=$ANSIBLE_VERBOSITY
66+
fi
6567
unset ANSIBLE_VERBOSITY
6668
if [ ! -f "$1" ]; then
6769
log_info "Skipping redaction of: $1"
@@ -75,7 +77,9 @@ function redact_file {
7577
$KAYOBE_AUTOMATION_UTILS_PATH/kayobe-automation-redact <($ANSIBLE_VAULT view --vault-password-file $KAYOBE_AUTOMATION_UTILS_PATH/kayobe-automation-vault-helper $1) >$1.redact
7678
fi
7779
mv $1.redact $1
78-
export ANSIBLE_VERBOSITY=$_ANSIBLE_VERBOSITY
80+
if [ ! -z ${_ANSIBLE_VERBOSITY:+x} ]; then
81+
export ANSIBLE_VERBOSITY=$_ANSIBLE_VERBOSITY
82+
fi
7983
}
8084

8185
function encrypt_file {

0 commit comments

Comments
 (0)