From 80fffbad1116d215669d2a716b1bc629f47ef6a5 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 19 Dec 2013 11:21:44 +0100 Subject: [PATCH] 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