aboutsummaryrefslogtreecommitdiff
path: root/src/deployment.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-17 23:43:43 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-18 09:55:57 -0700
commite9253b36fb98b0cd34dd2be9693240648bb031c8 (patch)
tree1086289a4785f5a23971e4b6b9644cbd8c2aacdd /src/deployment.lisp
parent4cebd173cf53fe0bc3e0b846e0535399e82920bc (diff)
downloadconsfigurator-e9253b36fb98b0cd34dd2be9693240648bb031c8.tar.gz
improve the DEFUN defined for calling properties programmatically
- Move the connection type check to %CONSFIGURE, so that we're not doing the check over and over again for propapps combined by property combinators. - Splice the check back in when writing the DEFUN. - Issue a warning when a property with a :HOSTATTRS subroutine is used programmatically. - DEFUN now has property's lambda list, rather than just (&REST ARGS). Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/deployment.lisp')
-rw-r--r--src/deployment.lisp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/deployment.lisp b/src/deployment.lisp
index 5dbafbb..d4a7500 100644
--- a/src/deployment.lisp
+++ b/src/deployment.lisp
@@ -25,7 +25,11 @@
Assumes HOST has already had its :HOSTATTRS subroutines run, and arguments to
connections in CONNECTIONS have been both normalised and preprocessed."
(labels
- ((connect (connections)
+ ((apply-propspec (propspec)
+ (let ((propapp (eval-propspec propspec)))
+ (assert-connection-supports (propapptype propapp))
+ (propappapply propapp)))
+ (connect (connections)
(destructuring-bind ((type . args) . remaining) connections
;; implementations of ESTABLISH-CONNECTION which call
;; CONTINUE-DEPLOY* or CONTINUE-DEPLOY*-PROGRAM return nil to us
@@ -33,7 +37,7 @@ connections in CONNECTIONS have been both normalised and preprocessed."
(apply #'establish-connection type remaining args)))
(if remaining
(connect remaining)
- (propappapply (eval-propspec (host-propspec *host*))))
+ (apply-propspec (host-propspec *host*)))
(connection-teardown *connection*)))))
(let ((*host* (preprocess-host host)))
(connect (if (eq :local (caar connections))