diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-05-29 15:12:54 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-05-30 10:03:03 -0700 |
commit | edbba484918f6de83680a5b29e561fba981e05e9 (patch) | |
tree | 9418abacd664e22fe7dde4137d8962825943d168 /src/host.lisp | |
parent | dc396f800b11fc9aa4bae07df268ad51a2740d8b (diff) | |
download | consfigurator-edbba484918f6de83680a5b29e561fba981e05e9.tar.gz |
factor out ENSURE-HOST & call it in hostattrs accessors
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/host.lisp')
-rw-r--r-- | src/host.lisp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/host.lisp b/src/host.lisp index a449d3c..50155c8 100644 --- a/src/host.lisp +++ b/src/host.lisp @@ -49,6 +49,13 @@ (:documentation "A host whose :PREPROCESS and :HOSTATTRS subroutines have not been run.")) +(defgeneric ensure-host (host) + (:documentation "Return the HOST value designated by HOST.") + (:method ((host host)) + host) + (:method ((hostname string)) + (make-host :hostattrs `(:hostname (,hostname))))) + (defmethod shallow-copy-host ((host host)) (make-instance (type-of host) :hostattrs (copy-list (hostattrs host)) |