From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gb5pO-0001E9-QY for guix-patches@gnu.org; Sun, 23 Dec 2018 10:38:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gb5pK-00066V-Md for guix-patches@gnu.org; Sun, 23 Dec 2018 10:38:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gb5pK-00066I-IX for guix-patches@gnu.org; Sun, 23 Dec 2018 10:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gb5pK-0003hZ-7m for guix-patches@gnu.org; Sun, 23 Dec 2018 10:38:02 -0500 Subject: [bug#33836] [PATCH] services: zabbix-front-end: Show location in messages. Resent-Message-ID: From: Oleg Pykhalov Date: Sun, 23 Dec 2018 18:36:33 +0300 Message-Id: <20181223153633.13009-1-go.wigust@gmail.com> In-Reply-To: <874lb45nov.fsf@gmail.com> References: <874lb45nov.fsf@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33836@debbugs.gnu.org * gnu/services/monitoring.scm (zabbix-front-end-config): Show location in messages. --- gnu/services/monitoring.scm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm index 685641f11..90eda6561 100644 --- a/gnu/services/monitoring.scm +++ b/gnu/services/monitoring.scm @@ -29,6 +29,7 @@ #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix records) + #:use-module (guix utils) #:use-module ((guix ui) #:select (display-hint)) #:use-module (ice-9 match) #:use-module (ice-9 rdelim) @@ -512,7 +513,7 @@ create it manually.") (define zabbix-front-end-config (match-lambda (($ - _ db-host db-port db-name db-user db-password db-secret-file + location _ db-host db-port db-name db-user db-password db-secret-file zabbix-host zabbix-port) (mixed-text-file "zabbix.conf.php" "\ @@ -527,18 +528,25 @@ $DB['DATABASE'] = '" db-name "'; $DB['USER'] = '" db-user "'; $DB['PASSWORD'] = '" (if (string-null? db-password) (if (string-null? db-secret-file) - (raise (condition - (&message - (message "\ -you must provide either 'db-secret-file' or 'db-password'")))) + (raise (make-compound-condition + (condition + (&message + (message "\ +you must provide either 'db-secret-file' or 'db-password'"))) + (condition + (&error-location (location location))))) (string-trim-both (with-input-from-file db-secret-file read-string))) (begin - (display-hint "\ -Consider using @code{db-secret-file} instead of @code{db-password} and unset -@code{db-password} for security in @code{zabbix-front-end-configuration}.") - db-password)) "'; + (display-hint (format #f + "~{~a: ~}Consider using +@code{db-secret-file} instead of @code{db-password} and unset +@code{db-password} for security in @code{zabbix-front-end-configuration}." + (list (location-file location) + (location-line location) + (location-column location)))) +db-password)) "'; // Schema name. Used for IBM DB2 and PostgreSQL. $DB['SCHEMA'] = ''; -- 2.20.1