From 9d54eb7257a3b27830fc92f0855f6c01d807be8d Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 19 Dec 2013 11:21:26 +0100 Subject: [PATCH 1/2] implement messaging for __group type Signed-off-by: Steven Armstrong --- cdist/conf/type/__group/gencode-remote | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cdist/conf/type/__group/gencode-remote b/cdist/conf/type/__group/gencode-remote index bb6797c2..1cffa8d4 100755 --- a/cdist/conf/type/__group/gencode-remote +++ b/cdist/conf/type/__group/gencode-remote @@ -58,10 +58,12 @@ if grep -q "^${name}:" "$__object/explorer/group"; then if [ "$new_value" != "$current_value" ]; then set -- "$@" "$proparg" \"$new_value\" + echo change $property $new_value $current_value >> "$__messages_out" fi done if [ $# -gt 0 ]; then + echo mod >> "$__messages_out" case $os in freebsd) echo pw group mod "$@" "$name" @@ -72,6 +74,7 @@ if grep -q "^${name}:" "$__object/explorer/group"; then esac fi else + echo add >> "$__messages_out" for property in $(ls .); do new_value="$(cat "$property")" if [ "$os" = "freebsd" ]; then @@ -95,6 +98,7 @@ else fi set -- "$@" "$proparg" \"$new_value\" + echo set $property $new_value >> "$__messages_out" done case $os in From 80fffbad1116d215669d2a716b1bc629f47ef6a5 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 19 Dec 2013 11:21:44 +0100 Subject: [PATCH 2/2] implement messaging for __user type Signed-off-by: Steven Armstrong --- cdist/conf/type/__user/gencode-remote | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cdist/conf/type/__user/gencode-remote b/cdist/conf/type/__user/gencode-remote index a2cdfd22..892bb8e1 100755 --- a/cdist/conf/type/__user/gencode-remote +++ b/cdist/conf/type/__user/gencode-remote @@ -89,10 +89,12 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then if [ "$new_value" != "$current_value" ]; then set -- "$@" "$(shorten_property $property)" \'$new_value\' + echo change $property $new_value $current_value >> "$__messages_out" fi done if [ $# -gt 0 ]; then + echo mod >> "$__messages_out" if [ "$os" = "freebsd" ]; then echo pw usermod "$@" "$name" else @@ -102,12 +104,15 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then true fi else + echo add >> "$__messages_out" for property in $(ls .); do new_value="$(cat "$property")" if [ -z "$new_value" ];then # Boolean values have no value set -- "$@" "$(shorten_property $property)" + echo set $property >> "$__messages_out" else set -- "$@" "$(shorten_property $property)" \'$new_value\' + echo set $property $new_value >> "$__messages_out" fi done