diff options
author | Jordan Galby <67924449+Jordan474@users.noreply.github.com> | 2024-08-28 18:38:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-28 18:38:54 +0200 |
commit | 6b0011c8f1293510a784a0eaa0a2a10e03339f16 (patch) | |
tree | 7d407b5b798377d26df57b0158c2082ac579a148 /lib | |
parent | 8b5521ec0a30b3486239c69a21168968fb39a2f7 (diff) | |
download | spack-6b0011c8f1293510a784a0eaa0a2a10e03339f16.tar.gz spack-6b0011c8f1293510a784a0eaa0a2a10e03339f16.tar.bz2 spack-6b0011c8f1293510a784a0eaa0a2a10e03339f16.tar.xz spack-6b0011c8f1293510a784a0eaa0a2a10e03339f16.zip |
For "when:" and install_environment.json: Support fully qualified hostname (#45522)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/docs/environments.rst | 5 | ||||
-rw-r--r-- | lib/spack/spack/spec.py | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/spack/docs/environments.rst b/lib/spack/docs/environments.rst index ffa5e5f3c3..b3dd57840b 100644 --- a/lib/spack/docs/environments.rst +++ b/lib/spack/docs/environments.rst @@ -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 diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 1fb21b348b..92e70e90da 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -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(), } |