-
Notifications
You must be signed in to change notification settings - Fork 229
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
Ensure config file ends with a new line #707
Conversation
Last time I tried this, it didn't do what I wanted. From the reference:
We also add newlines in places and this resulted in a hard to read file. Is this still the case? |
Ha, right! :)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed this fixes it and is much cleaner
I remember @bastelfreak trying to make a similar change and us deciding that it wasn't this easy. puppet::config::entry {'example_setting 1':
key => 'example_setting',
value => '1',
section => 'example_section',
}
puppet::config::entry {'example_setting 2':
key => 'example_setting',
value => '2',
section => 'example_section',
} would have previously generated...
now it generates
|
@@ -39,7 +39,7 @@ | |||
if (!defined(Concat::Fragment["puppet.conf_${section}_${key}"])){ | |||
concat::fragment{"puppet.conf_${section}_${key}": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fragment will always get a newline now. This breaks adding multiple values to the same key via different instances of puppet::config::entry
(the resources added in the else
below).
Here's the IRC logs. https://gist.github.com/alexjfisher/30fe5623f620c5af5666a93407e9e284 |
Adding multiple values to the same key with different |
It looks very deliberate to me. The fragment in the |
Right! :( Removing it does indeed sound like a better option than just leaving it in. @ekohl What do you think? |
The puppet.conf file doesn't end with a newline which makes it hard to
cat
. This ensure that the file will end with a newline.