-
Notifications
You must be signed in to change notification settings - Fork 220
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
Fixes some autosign.conf issues (comments, EOL on last line) #59
Conversation
@@ -59,7 +59,7 @@ def autosign certname | |||
|
|||
# list of hosts which are now allowed to be installed via autosign | |||
def autosign_list | |||
File.exist?(autosign_file) ? File.read(autosign_file).split : [] | |||
File.exist?(autosign_file) ? File.read(autosign_file).split("\n").reject { |v| v =~ /^\s*#.*|^$/ } : [] |
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.
The change to split means trailing spaces aren't stripped any more, perhaps add a .map {|v| v.chomp}
or similar?
+1 tested OK, with one comment above. |
Also, there seem to be no tests for parsing the autosign file? :/ |
@vStone thanks. Indeed, contributions welcome! |
…autosign and make sure the autosign file contains a EOL on the last line
Added some tests and also fix some other tests that were failing for no good (trivial) reason. |
@domcleal mind giving this a go if you have time before puppetcamp? I know I wont :( |
Ignore commented lines when reading all certificates in autosign and make sure the autosign file contains a EOL on the last line