aboutsummaryrefslogtreecommitdiff
path: root/src/host.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-29 14:59:42 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-30 10:03:03 -0700
commitdc396f800b11fc9aa4bae07df268ad51a2740d8b (patch)
tree47d292422b9b65e23ebda86732903a3fa5b1efc3 /src/host.lisp
parentfb89c160bad4fff16e54812b60ddc74f3c957fef (diff)
downloadconsfigurator-dc396f800b11fc9aa4bae07df268ad51a2740d8b.tar.gz
hostattrs accessors: call PREPROCESS-HOST in some situations
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/host.lisp')
-rw-r--r--src/host.lisp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/host.lisp b/src/host.lisp
index acda791..a449d3c 100644
--- a/src/host.lisp
+++ b/src/host.lisp
@@ -80,6 +80,10 @@ attributes, so that implementations of ESTABLISH-CONNECTION can push new
attributes (typically to request prerequisite data) without disturbing host
values higher up the call stack."))
+(defparameter *preprocessing-host* nil
+ "HOST value currently being preprocessed.
+Used by GET-HOSTATTRS to break infinite loops.")
+
(defmethod preprocess-host ((host preprocessed-host))
(shallow-copy-host host))
@@ -87,7 +91,8 @@ values higher up the call stack."))
(let ((*host* (make-instance
'preprocessed-host
:hostattrs (copy-list (hostattrs host))
- :propspec (preprocess-propspec (host-propspec host)))))
+ :propspec (preprocess-propspec (host-propspec host))))
+ (*preprocessing-host* host))
(propappattrs (eval-propspec (host-propspec *host*)))
*host*))