aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-04-02 12:48:47 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-04-02 12:48:47 -0700
commitcbe56ebc323afa15d5aa2e1f918e01d660c6f322 (patch)
treeeea3081b1dee33c70297517619c72b4780736c19
parent2b7fbca1d47ee1a5df2a44eda597852391f8c5c7 (diff)
downloadconsfigurator-cbe56ebc323afa15d5aa2e1f918e01d660c6f322.tar.gz
DEFAULT-DEPLOYMENT: leave unbound when not supplied
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/deployment.lisp10
-rw-r--r--src/host.lisp14
2 files changed, 10 insertions, 14 deletions
diff --git a/src/deployment.lisp b/src/deployment.lisp
index 3a3d404..09fecd0 100644
--- a/src/deployment.lisp
+++ b/src/deployment.lisp
@@ -199,17 +199,11 @@ You can then eval (NAME) to execute this deployment."
(defun hostdeploy* (host &optional additional-properties)
"Like DEPLOY*, but use the host's default deployment."
- (deploy* (or (host-deployment host)
- (simple-program-error "Host has no default deployment"))
- host
- additional-properties))
+ (deploy* (host-deployment host) host additional-properties))
(defun hostdeploy-these* (host properties)
"Like DEPLOY-THESE*, but use the host's default deployment."
- (deploy-these* (or (host-deployment host)
- (simple-program-error "Host has no default deployment"))
- host
- properties))
+ (deploy-these* (host-deployment host) host properties))
(defmacro hostdeploy (host &body additional-properties)
"Like DEPLOY, but use the host's default deployment."
diff --git a/src/host.lisp b/src/host.lisp
index 979ab8c..6a638e6 100644
--- a/src/host.lisp
+++ b/src/host.lisp
@@ -30,7 +30,6 @@
:reader host-propspec
:documentation "Propspec of the properties to be applied to the host.")
(default-deployment
- :initform nil
:initarg :deploy
:reader host-deployment
:documentation
@@ -100,9 +99,11 @@ values higher up the call stack."))
(propappattrs (eval-propspec (host-propspec *host*)))
*host*))
-(defun make-host (&key hostattrs (propspec (make-propspec)) deploy)
- (make-instance 'unpreprocessed-host
- :hostattrs hostattrs :propspec propspec :deploy deploy))
+(defun make-host
+ (&key hostattrs (propspec (make-propspec)) (deploy nil deploy-supplied-p))
+ (apply #'make-instance 'unpreprocessed-host
+ :hostattrs hostattrs :propspec propspec
+ (and deploy-supplied-p `(:deploy ,deploy))))
(defun make-child-host (&key hostattrs propspec)
"Make a host object to represent a chroot, container or the like.
@@ -148,7 +149,8 @@ Called by properties which set up such subhosts, like CHROOT:OS-BOOTSTRAPPED."
(propspec-systems (host-propspec host)))
:propspec (propspec-props propspec))))
-(defmacro defhost (hostname (&key deploy) &body properties)
+(defmacro defhost
+ (hostname (&key (deploy nil deploy-supplied-p)) &body properties)
"Define a host with hostname HOSTNAME and properties PROPERTIES.
HOSTNAME can be a string or a symbol. In either case, the host will get a
static informational property with its hostname as a string, and the symbol
@@ -187,7 +189,7 @@ entries."
(make-host :hostattrs ',attrs
:propspec (make-propspec
:propspec (props seqprops ,@properties))
- :deploy ',deploy)
+ ,@(and deploy-supplied-p `(:deploy ',deploy)))
,(car (getf attrs :desc)))
,@(and deploy
`((defdeploy ,hostname-sym (,deploy ,hostname-sym)))))))