From 7ee56d099f6fe7546a2e0b7093edec6756acde51 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Wed, 27 Sep 2017 12:19:07 +0200 Subject: [PATCH] resolved #444 add messaging to __line-type (#580) #444 Add messaging to __line-type --- cdist/conf/type/__line/gencode-remote | 6 ++++-- cdist/conf/type/__line/man.rst | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__line/gencode-remote b/cdist/conf/type/__line/gencode-remote index b9f118b1..fa051951 100755 --- a/cdist/conf/type/__line/gencode-remote +++ b/cdist/conf/type/__line/gencode-remote @@ -60,6 +60,7 @@ case "$state_should" in # Only replace ' with '"'"' and keep \ as they are line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g") printf '%s' "printf '%s\n' '$line_sanitised' >> $file" + echo "added" >> "$__messages_out" ;; absent) @@ -83,9 +84,10 @@ fi grep -v $greparg '$regex' '$file' > \$tmpfile || true mv -f "\$tmpfile" "$file" eof + echo "removed" >> "$__messages_out" ;; *) - echo "Unknown state: $state_should" >&2 - exit 1 + echo "Unknown state: $state_should" >&2 + exit 1 ;; esac diff --git a/cdist/conf/type/__line/man.rst b/cdist/conf/type/__line/man.rst index e6adce9c..b63ea2b3 100644 --- a/cdist/conf/type/__line/man.rst +++ b/cdist/conf/type/__line/man.rst @@ -40,6 +40,13 @@ file If supplied, use this as the destination file. Otherwise the object_id is used. +MESSAGES +-------- +added + The line was added. + +removed + The line was removed. EXAMPLES --------