aboutsummaryrefslogtreecommitdiff
path: root/src/property/network.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-08-27 14:32:16 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-08-31 15:30:50 -0700
commitab469268b42d8fc8b0a180990be40e925a65935a (patch)
tree3b18ccc1fc99dfeded420634b4e529e1203881e1 /src/property/network.lisp
parent7e72e55e996b29ba775e6695ee1f85ce637dc90a (diff)
downloadconsfigurator-ab469268b42d8fc8b0a180990be40e925a65935a.tar.gz
rework PUSHNEW-HOSTATTRS to use EQUAL not EQL & add PUSHNEW-HOSTATTR
Previously, PUSHNEW-HOSTATTRS always used EQL to determine whether a hostattr was already pushed, which would give the wrong answer for many common cases. Now default to using EQUAL, and provide a way for the caller to specify the test function. PUSHNEW-HOSTATTRS now takes a list of hostattrs as a single parameter, rather than using &REST, in order to make room for the new :TEST keyword parameter. To mitigate the inconvenience of no longer using &REST, add PUSHNEW-HOSTATTR. Also fix some parameter and function names in docstrings. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/network.lisp')
-rw-r--r--src/property/network.lisp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/property/network.lisp b/src/property/network.lisp
index 0a59428..4ac849a 100644
--- a/src/property/network.lisp
+++ b/src/property/network.lisp
@@ -23,9 +23,9 @@
server might have aliases like imap.example.org and smtp.example.org, even
though its hostname is neither 'imap' nor 'smtp'."
(:desc (format nil "Has alias~1{~#[es~;~;es~]~} ~:*~{~A~^, ~}" aliases))
- (:hostattrs (apply #'pushnew-hostattrs
- :aliases (delete (get-hostname) (flatten aliases)
- :test #'string=))))
+ (:hostattrs
+ (pushnew-hostattrs
+ :aliases (delete (get-hostname) (flatten aliases) :test #'string=))))
(defprop ipv4 :posix (&rest addresses)
"Record the host's public Internet IPv4 addresses.
@@ -35,7 +35,7 @@ similar property which pushes hostattrs identified by a non-keyword
symbol (unless your consfig deals only in hosts without public IP addresses,
in which case you can use this property)."
(:desc (format nil "Has public IPv4 ~{~A~^, ~}" addresses))
- (:hostattrs (apply #'pushnew-hostattrs :ipv4 (flatten addresses))))
+ (:hostattrs (pushnew-hostattrs :ipv4 (flatten addresses))))
(defprop ipv6 :posix (&rest addresses)
"Record the host's public Internet IPv6 addresses.
@@ -45,7 +45,7 @@ similar property which pushes hostattrs identified by a non-keyword
symbol (unless your consfig deals only in hosts without public IP addresses,
in which case you can use this property)."
(:desc (format nil "Has public IPv6 ~{~A~^, ~}" addresses))
- (:hostattrs (apply #'pushnew-hostattrs :ipv6 (flatten addresses))))
+ (:hostattrs (pushnew-hostattrs :ipv6 (flatten addresses))))
(defproplist clean-/etc/network/interfaces :posix ()
"Empty /etc/network/interfaces in preparation for configuring interfaces using