diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-06-03 12:54:38 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-06-03 13:18:22 -0700 |
commit | f5ca06034de2419af05cbe7a5e738ce0353f7c52 (patch) | |
tree | 875e539a38aa9866e71bf1484d9f11d7777010a2 | |
parent | fbafc55b91b2996565d39c0316302f5afdf3e1df (diff) | |
download | consfigurator-f5ca06034de2419af05cbe7a5e738ce0353f7c52.tar.gz |
add GET-SHORT-HOSTNAME
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/package.lisp | 1 | ||||
-rw-r--r-- | src/property.lisp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/package.lisp b/src/package.lisp index 07c87f7..077a5ff 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -154,6 +154,7 @@ #:push-hostattrs #:pushnew-hostattrs #:get-hostname + #:get-short-hostname #:require-data #:failed-change #:assert-euid-root 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 |