Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a newline after hostname entry #60

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

bwarden
Copy link
Member

@bwarden bwarden commented Jan 26, 2023

Always add a newline after printing the hostname: entry, just in case userdata API call returns just the hostname.
Update the test data to just such a bare hostname.

Fixes #59

@bwarden bwarden requested a review from bryteise January 26, 2023 22:32
Always add a newline after printing the hostname: entry, just in case
userdata API call returns *just* the hostname.
Update the test data to just such a bare hostname.

Fixes clearlinux#59
@bwarden bwarden force-pushed the fix-hostname-no-newline branch from 6872cc3 to 73cf865 Compare January 26, 2023 22:33
@@ -1 +1 @@
myhostname
myhostname
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to not have both the newline including file and not (I might not be understanding how tests work).

Copy link
Member Author

Choose a reason for hiding this comment

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

The test spawns a web server that serves the literal contents of the files under tests/fetch_data. It would be good to restructure the test to support multiple scenarios like that, but not presently supported.

@bwarden
Copy link
Member Author

bwarden commented Jan 26, 2023

Prettier solution would be to make write_lines() check that the last character it writes is a newline, adding it if not.

@bwarden bwarden force-pushed the fix-hostname-no-newline branch from a26fcd0 to 4969696 Compare January 26, 2023 23:58
@bwarden
Copy link
Member Author

bwarden commented Jan 26, 2023

Reworked to make write_lines() do the work, and took out my extraneous newline added after SSH keys.

@bwarden bwarden merged commit 914ef19 into clearlinux:master Jan 27, 2023
@bwarden bwarden deleted the fix-hostname-no-newline branch March 20, 2023 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New hostname feature breaks user-data
3 participants