aboutsummaryrefslogtreecommitdiff
path: root/src/property.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-03 12:54:38 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-03 13:18:22 -0700
commitf5ca06034de2419af05cbe7a5e738ce0353f7c52 (patch)
tree875e539a38aa9866e71bf1484d9f11d7777010a2 /src/property.lisp
parentfbafc55b91b2996565d39c0316302f5afdf3e1df (diff)
downloadconsfigurator-f5ca06034de2419af05cbe7a5e738ce0353f7c52.tar.gz
add GET-SHORT-HOSTNAME
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r--src/property.lisp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/property.lisp b/src/property.lisp
index 52c040d..8b38db9 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -525,6 +525,13 @@ being applied.
Called by property subroutines."
(get-hostattrs-car :hostname host))
+(defun get-short-hostname (&optional (host *host*))
+ "Get the short hostname of HOST, defaulting to the host to which properties
+are being applied.
+
+Called by property subroutines."
+ (car (split-string (get-hostattrs-car :hostname host) :separator ".")))
+
;;;; :APPLY subroutines