mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
gnu: services: Fix fail2ban configuration serialization.
This fixes a regression from 543d971ed2
whereby
match-lambda due to configuration field reordering.
* gnu/services/security.scm:
[serialize-fail2ban-ignore-cache-configuration]: Switch to match-record.
[serialize-fail2ban-jail-filter-configuration]: Switch to match-record.
[serialize-fail2ban-jail-action-configuration]: Switch to match-record.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
d0942bfd2d
commit
dc403ec7f1
1 changed files with 20 additions and 20 deletions
|
@ -42,11 +42,11 @@ (define-configuration/no-serialization fail2ban-ignore-cache-configuration
|
|||
(max-count integer "Cache size.")
|
||||
(max-time integer "Cache time."))
|
||||
|
||||
(define serialize-fail2ban-ignore-cache-configuration
|
||||
(match-lambda
|
||||
(($ <fail2ban-ignore-cache-configuration> _ key max-count max-time)
|
||||
(format #f "key=\"~a\", max-count=~d, max-time=~d"
|
||||
key max-count max-time))))
|
||||
(define (serialize-fail2ban-ignore-cache-configuration config)
|
||||
(match-record config <fail2ban-ignore-cache-configuration>
|
||||
(key max-count max-time)
|
||||
(format #f "key=\"~a\", max-count=~d, max-time=~d"
|
||||
key max-count max-time)))
|
||||
|
||||
(define-maybe/no-serialization string)
|
||||
|
||||
|
@ -54,10 +54,10 @@ (define-configuration/no-serialization fail2ban-jail-filter-configuration
|
|||
(name string "Filter to use.")
|
||||
(mode maybe-string "Mode for filter."))
|
||||
|
||||
(define serialize-fail2ban-jail-filter-configuration
|
||||
(match-lambda
|
||||
(($ <fail2ban-jail-filter-configuration> _ name mode)
|
||||
(format #f "~a~@[[mode=~a]~]" name (maybe-value mode)))))
|
||||
(define (serialize-fail2ban-jail-filter-configuration config)
|
||||
(match-record config <fail2ban-jail-filter-configuration>
|
||||
(name mode)
|
||||
(format #f "~a~@[[mode=~a]~]" name (maybe-value mode))))
|
||||
|
||||
(define (argument? a)
|
||||
(and (pair? a)
|
||||
|
@ -86,17 +86,17 @@ (define (serialize-fail2ban-jail-action-configuration-arguments args)
|
|||
(format #f "~a=~a" (car e) (any-value (cdr e))))))
|
||||
(format #f "~a" (string-join (map key-value args) ","))))
|
||||
|
||||
(define serialize-fail2ban-jail-action-configuration
|
||||
(match-lambda
|
||||
(($ <fail2ban-jail-action-configuration> _ name arguments)
|
||||
(format
|
||||
#f "~a~a"
|
||||
name
|
||||
(if (null? arguments) ""
|
||||
(format
|
||||
#f "[~a]"
|
||||
(serialize-fail2ban-jail-action-configuration-arguments
|
||||
arguments)))))))
|
||||
(define (serialize-fail2ban-jail-action-configuration config)
|
||||
(match-record config <fail2ban-jail-action-configuration>
|
||||
(name arguments)
|
||||
(format
|
||||
#f "~a~a"
|
||||
name
|
||||
(if (null? arguments) ""
|
||||
(format
|
||||
#f "[~a]"
|
||||
(serialize-fail2ban-jail-action-configuration-arguments
|
||||
arguments))))))
|
||||
|
||||
(define fail2ban-backend->string
|
||||
(match-lambda
|
||||
|
|
Loading…
Reference in a new issue