You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
just want let you know, that, when using hiera and JSON as backend, true and false never get matched because of the mssing single quote.
So, basically every JSON encoder will set single or double quotes for every value.
My simple solution: (share.pp)
E.g:
Old:
$read_only ? {
true => "set "${target}/read only" yes",
false => "set "${target}/read only" no",
default => "rm "${target}/read only"",
}
The problem here is that you are trying to do 1 of 3 operations with a binary option. Best to just decide on what the actual default will be (t/f) and use that as a default setting with an override:
man smb.conf:
read only (S)
An inverted synonym is writeable.
Default: read only = yes
Hi,
just want let you know, that, when using hiera and JSON as backend, true and false never get matched because of the mssing single quote.
So, basically every JSON encoder will set single or double quotes for every value.
My simple solution: (share.pp)
E.g:
Old:
$read_only ? {
true => "set "${target}/read only" yes",
false => "set "${target}/read only" no",
default => "rm "${target}/read only"",
}
New:
$read_only ? {
'true' => "set "${target}/read only" yes",
'false' => "set "${target}/read only" no",
default => "rm "${target}/read only"",
}
It's also good practice to set strings withing single quotes like:
https://docs.puppet.com/puppet/latest/reference/lang_conditional.html
Rgds.
Franz
The text was updated successfully, but these errors were encountered: