util
_util
¶
Re-exports the executor-only timezone helper.
Standalone — no terok-executor domain imports, safe to use from any layer.
Cross-package helpers (ensure_dir, podman_userns_args, the round-trip
YAML facade in terok_util.yaml, ...) live in the shared
terok_util package and are imported from there directly.
__all__ = ['detect_host_timezone']
module-attribute
¶
detect_host_timezone()
¶
Return the host's IANA timezone name, or None if it can't be detected.
Tried in order:
$TZ— the user's explicit override./etc/timezone— Debian/Ubuntu convention, single-line zone name./etc/localtimesymlink — systemd-family hosts (and macOS) symlink this into the zoneinfo database; the zone name is the path suffix after thezoneinfo/component.
Returns None on hosts that expose none of the above (containers with
only a copied-in /etc/localtime file, for instance), letting the
caller fall back to the image default rather than guessing.