From 3a94e3bc59e5592da73144668396ec8e3463e1fd Mon Sep 17 00:00:00 2001
From: intrigeri <intrigeri@boum.org>
Date: Sat, 25 Feb 2012 15:04:38 +0100
Subject: [PATCH] Report duplicity failure output at error loglevel so that it
 is emailed.

---
 ChangeLog       | 2 ++
 handlers/dup.in | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8a75d2f..c6fb650 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@ version 1.0 -- UNRELEASED
 	 . Adapt for new duplicity SSH backend.
 	   Support bandwidthlimit with new duplicity, using trickle.
 	   (Closes: #657201)
+	 . Report failure output at error loglevel so that it is emailed
+	   (Closes: #536858)
 	mysql:
 	 . Don't attempt to dump performance_schema database (Redmine#3741).
 	pgsql:
diff --git a/handlers/dup.in b/handlers/dup.in
index f9f4de4..9eb2fbb 100644
--- a/handlers/dup.in
+++ b/handlers/dup.in
@@ -339,7 +339,11 @@ if [ ! $test ]; then
    exit_code=$?
    debug $output
    cat $outputfile | (while read output ; do
-                         info $output
+                         if [ $exit_code -eq 0 ]; then
+                            info $output
+                         else
+                            error $output
+                         fi
                       done
    )
    if [ $exit_code -eq 0 ]; then
-- 
GitLab