Fix the sample usage in the README
If you follow the example in the README you may not have implemented the :key_value_separator parameter in your type, and you get the wonderful failure case: Puppet::Error: Invalid parameter key_val_separator(:key_val_separator) This change looks first, and if the user hasn't specified that attribute in their type in their type, it falls back to '='
This commit is contained in:
parent
e5898439c5
commit
857496424c
1 changed files with 5 additions and 1 deletions
|
@ -83,7 +83,11 @@ Puppet::Type.type(:ini_setting).provide(:ruby) do
|
|||
end
|
||||
|
||||
def separator
|
||||
resource[:key_val_separator] || '='
|
||||
if resource.class.validattr?(:key_val_separator)
|
||||
resource[:key_val_separator] || '='
|
||||
else
|
||||
'='
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue