-
Notifications
You must be signed in to change notification settings - Fork 99
Add password_file to type #20
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
Conversation
isrequired | ||
newparam(:password_file) do | ||
desc 'The path to a file containing the password used to protect the | ||
keystore. This cannot be used together with :password.' |
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.
You can probably add a validate block to check if someone specifies both :password_file and :password, like so: https://github.com/puppetlabs/puppetlabs-firewall/blob/master/lib/puppet/type/firewall.rb#L727-L729
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.
Thanks. Fixed (see below).
if File.exists?(@resource[:target]) and not File.zero?(@resource[:target]) | ||
tmpfile.write("#{@resource[:password]}\n#{@resource[:password]}") | ||
|
||
tmpfile = nil |
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 adds a lot of logic to this method; I think that this could be extracted to a private method and called here to make this a bit more simple.
@adrienthebo: I added a |
Thanks for merging. I will now move on to the puppetdb part of using this change :-) |
This PR adds a
password_file
parameter to pass a file instead of a string for the password.Note: the provider specs are broken in master, I did not intend to fix them.