Skip to content

Commit 6b0011c

Browse files
authored
For "when:" and install_environment.json: Support fully qualified hostname (#45522)
1 parent 8b5521e commit 6b0011c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/spack/docs/environments.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,9 @@ The valid variables for a ``when`` clause are:
893893

894894
#. ``env``. The user environment (usually ``os.environ`` in Python).
895895

896-
#. ``hostname``. The hostname of the system (if ``hostname`` is an
897-
executable in the user's PATH).
896+
#. ``hostname``. The hostname of the system.
897+
898+
#. ``full_hostname``. The fully qualified hostname of the system.
898899

899900
^^^^^^^^^^^^^^^^^^^^^^^^
900901
SpecLists as Constraints

lib/spack/spack/spec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4892,6 +4892,7 @@ def get_host_environment() -> Dict[str, Any]:
48924892
"architecture": arch_spec,
48934893
"arch_str": str(arch_spec),
48944894
"hostname": socket.gethostname(),
4895+
"full_hostname": socket.getfqdn(),
48954896
}
48964897

48974898

0 commit comments

Comments
 (0)