aboutsummaryrefslogtreecommitdiff
path: root/src/property.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-28 14:17:47 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-29 08:43:57 -0700
commit19d02c44af576e8c43229091308f5ef218917c28 (patch)
tree088a74a7d74747866017777814acf45704055764 /src/property.lisp
parent451b63e0481090813d060d231a0fee30c125eb30 (diff)
downloadconsfigurator-19d02c44af576e8c43229091308f5ef218917c28.tar.gz
add optional HOST arg to some accessors for hostattrs
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r--src/property.lisp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/property.lisp b/src/property.lisp
index 8ac2c76..2abb5e9 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -453,20 +453,20 @@ other than constant values and propapps to property combinators."
this property cannot be applied to this host. E.g. the property will try to
install an apt package but the host is FreeBSD.")
-(defun get-hostattrs (k)
+(defun get-hostattrs (k &optional (host *host*))
"Retrieve the list of static informational attributes of type KEY.
Called by property :HOSTATTRS, :APPLY and :UNAPPLY subroutines."
- (getf (slot-value *host* 'hostattrs) k))
+ (getf (slot-value host 'hostattrs) k))
-(defun get-hostattrs-car (k)
- (car (get-hostattrs k)))
+(defun get-hostattrs-car (k &optional (host *host*))
+ (car (get-hostattrs k host)))
-(defun get-parent-hostattrs (k)
- (getf (get-hostattrs :parent-hostattrs) k))
+(defun get-parent-hostattrs (k &optional (host *host*))
+ (getf (get-hostattrs :parent-hostattrs host) k))
-(defun get-parent-hostattrs-car (k)
- (car (get-parent-hostattrs k)))
+(defun get-parent-hostattrs-car (k &optional (host *host*))
+ (car (get-parent-hostattrs k host)))
(defun push-hostattrs (k &rest vs)
"Push new static informational attributes VS of type KEY.
@@ -489,11 +489,12 @@ is needed to deploy a property.
Called by property :HOSTATTRS subroutines."
(pushnew-hostattrs :data (cons iden1 iden2)))
-(defun get-hostname ()
- "Get the hostname of the host to which properties are being applied.
+(defun get-hostname (&optional (host *host*))
+ "Get the hostname of HOST, defaulting to the host to which properties are
+being applied.
Called by property subroutines."
- (get-hostattrs-car :hostname))
+ (get-hostattrs-car :hostname host))
;;;; :APPLY subroutines