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:
Richard Clamp 2013-06-12 16:25:39 +01:00
parent e5898439c5
commit 857496424c

View file

@ -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