GNU bug report logs -
#33836
[PATCH 0/2] location in define-configuration
Previous Next
Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>
Date: Sat, 22 Dec 2018 20:40:02 UTC
Severity: normal
Tags: fixed, patch
Done: Oleg Pykhalov <go.wigust <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 33836 <at> debbugs.gnu.org (full text, mbox):
* 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
(($ <zabbix-front-end-configuration>
- _ 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
This bug report was last modified 6 years and 68 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.