aboutsummaryrefslogtreecommitdiff
path: root/src/property/timezone.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-27 14:24:42 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-27 14:24:42 -0700
commit519c4dbd5a6ce576db4adf40c973b97c0d62b8c2 (patch)
tree4ba355a3c4aaf694f8eaf3c0ccb2831f313176b8 /src/property/timezone.lisp
parent91d85439b99f6d4cca0272b705cdea521364be8c (diff)
downloadconsfigurator-519c4dbd5a6ce576db4adf40c973b97c0d62b8c2.tar.gz
add TIMEZONE:CONFIGURED-FROM-PARENT
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/timezone.lisp')
-rw-r--r--src/property/timezone.lisp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/property/timezone.lisp b/src/property/timezone.lisp
index f0d8d10..6474b3d 100644
--- a/src/property/timezone.lisp
+++ b/src/property/timezone.lisp
@@ -21,6 +21,7 @@
(defproplist configured :posix (timezone)
"Set the system timezone. TIMEZONE is a relative path under /usr/share/zoneinfo,
e.g. \"Europe/London\"."
+ (:hostattrs (push-hostattrs 'timezone timezone))
(os:etypecase
(linux
(file:symlinked :from "/etc/localtime"
@@ -29,3 +30,8 @@ e.g. \"Europe/London\"."
(os:debianlike
(on-change (file:has-content "/etc/timezone" (list timezone))
(apt:reconfigured "tzdata")))))
+
+(defproplist configured-from-parent :posix ()
+ "Sets the system timezone to match the parent host's."
+ (configured (or (get-parent-hostattrs-car 'timezone)
+ (failed-change "Parent has no known timezone"))))