For "when:" and install_environment.json: Support fully qualified hostname (#45522)

This commit is contained in:
Jordan Galby 2024-08-28 18:38:54 +02:00 committed by GitHub
parent 8b5521ec0a
commit 6b0011c8f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -893,8 +893,9 @@ The valid variables for a ``when`` clause are:
#. ``env``. The user environment (usually ``os.environ`` in Python).
#. ``hostname``. The hostname of the system (if ``hostname`` is an
executable in the user's PATH).
#. ``hostname``. The hostname of the system.
#. ``full_hostname``. The fully qualified hostname of the system.
^^^^^^^^^^^^^^^^^^^^^^^^
SpecLists as Constraints

View File

@ -4892,6 +4892,7 @@ def get_host_environment() -> Dict[str, Any]:
"architecture": arch_spec,
"arch_str": str(arch_spec),
"hostname": socket.gethostname(),
"full_hostname": socket.getfqdn(),
}