-
-
Notifications
You must be signed in to change notification settings - Fork 18
Deprecation Request #34
Comments
I'm not sure how this boolean magic works, but if those files can replace this repo, than +1 for deprecation |
I recall that @alexjfisher discovered those built in types are unusable due to bugs but it might be good to ensure the built in types do work and we can deprecate this repo. |
At first glance and when accompanied with basic tests of a custom type i'm working on it seems to be working as i would expect.
Matcher to check for boolean type
Test verifies things get munged to booleans
|
At first glance it appears to work but theforeman/puppet-pulp#284 showed there were edge cases where it didn't. Maybe I shouldn't have included defaults when I refactored and I haven't had time to properly review it. |
@TraGicCode Try updating a boolean property from |
Having said that, I can't see why this module is any better. However you munge to The fix is probably
|
Thanks for the input @alexjfisher . Strange this has been around so long. Reminds me of the isrequired method still left behind on the type on the Puppet::Type class |
I've mentioned this elsewhere, I think, but I find it kind of odd that the desired behavior for booleans with types / providers is to allow true, false, "true", "false", "yes", etc., when the Puppet language types only allow true / false. Am I the only one who finds this a little inconsistent? Assuming you just want to allow those, wouldn't something like this work? |
I have to use this or Adrien Thebo's version because I'm munging 1's and 0's to true and false on some of the parameters for the subscription-manager module. It is really unpleasant but a user visible issue with the underlying system Puppet is abstracting. As a bonus, outputting the wrong entry in a property breaks the commands underlying the provider. Some can silently take the string true, others must be 1 or 0. Likewise, letting the property take on 1, 0, true, false or string equivalents means I'm letting a user direct mapping the expected resource appearance into Puppet. No need to explain that what is a true (takes 1 or 0) property or a regular boolean (takes true or false). The resource statement can be written to look like the actual on disk config. And I munge the values back to true or false correctly. |
I don't see how this module provides any benefit over what's now been in core puppet for years. https://github.com/puppetlabs/puppet/blob/e257636f1f3a7024593e33571d7eb5e2686744fc/lib/puppet/coercion.rb However, I still think both implementations are broken for properties. FWIW, subscription-manager doesn't use this anymore. waveclaw/puppet-subscription_manager@2c71a37#diff-490694a9db8f7a371538da1abe484314 |
I dropped boolean support completely in favor of treating the values as enumerations with exclusive dual values. The core feature is unusable and puppet-boolean has challenges in Puppet 6. My decision for supporting my modules should not affect your decisions on support of your code. I picked a pragmatic solution that supported external and internal customers of my code. Treating boolean logic as a special cased enumeration is not ideal but functional. |
Per voxpupuli/puppet-boolean#34 this module should be deprecated.
I will proceed and archive the module. |
I feel like we should deprecate this repo. in favor of using the puppet shipped
https://github.com/puppetlabs/puppet/tree/master/lib/puppet/parameter/boolean.rb and
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/property/boolean.rb
Any thoughts?
/cc @voxpupuli/collaborators
The text was updated successfully, but these errors were encountered: