From f16ac1911ddf86eee5ce8b620647cb93b0b7c386 Mon Sep 17 00:00:00 2001 From: Jason Staten Date: Wed, 16 Jan 2013 20:46:23 -0700 Subject: [PATCH] Set permissions on existing directory Previously, an existing directory would not have its permissions modified by the __directory type. This change removes exiting early when $state_is matches $state_should --- cdist/conf/type/__directory/gencode-remote | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cdist/conf/type/__directory/gencode-remote b/cdist/conf/type/__directory/gencode-remote index 21f4c5b6..e9023b60 100755 --- a/cdist/conf/type/__directory/gencode-remote +++ b/cdist/conf/type/__directory/gencode-remote @@ -21,8 +21,6 @@ state_should="present" [ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")" state_is="$(cat "$__object/explorer/state")" -[ "$state_should" = "$state_is" ] && exit 0 - destination="/$__object_id" mkdiropt="" @@ -32,7 +30,9 @@ recursive="" case "$state_should" in present) - echo mkdir $mkdiropt \"$destination\" + if [ "$state_is" != "present" ]; then + echo mkdir $mkdiropt \"$destination\" + fi # Mode settings if [ -f "$__object/parameter/mode" ]; then @@ -50,7 +50,9 @@ case "$state_should" in fi ;; absent) - echo rm -rf \"$destination\" + if [ "$state_is" != "absent" ]; then + echo rm -rf \"$destination\" + fi ;; *) echo "Unknown state: $state_should" >&2