Skip to content

Add full_hostname host variable#45522

Merged
bernhardkaindl merged 2 commits intospack:developfrom
Jordan474:hostname-is-fqdn
Aug 28, 2024
Merged

Add full_hostname host variable#45522
bernhardkaindl merged 2 commits intospack:developfrom
Jordan474:hostname-is-fqdn

Conversation

@Jordan474
Copy link
Copy Markdown
Contributor

@Jordan474 Jordan474 commented Jul 31, 2024

Makes the fully qualified hostname available as full_hostname variable in when: conditions.

This allows you to test against the site's domain name, rather than just the hostname.

This change also adds full_hostname field in the install_environment.json file.

@spackbot-app spackbot-app bot added the core PR affects Spack core functionality label Jul 31, 2024
Copy link
Copy Markdown
Contributor

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change also affects the hostname field in the install_environment.json file.

+        "full_hostname": socket.getfqdn(),

instead of

-        "hostname": socket.gethostname(),
+        "hostname": socket.getfqdn(),

The former would not break any existing environments, I think?

Makes fully qualified hostname available as `full_hostname` variable
in `when: ` conditions, and saved in install metadata.
@Jordan474 Jordan474 changed the title Change hostname to be the fully qualified hostname Add full_hostname host variable Aug 27, 2024
@spackbot-app spackbot-app bot added the documentation Improvements or additions to documentation label Aug 27, 2024
@Jordan474
Copy link
Copy Markdown
Contributor Author

Jordan474 commented Aug 27, 2024

Changed it to full_hostname.

Also updated the doc, which was outdated: spack doesn't use hostname executable anymore.

Copy link
Copy Markdown
Contributor

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, this looks safe now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants