We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a custom type with a boolean property defined as
newproperty(:myprop, parent: Puppet::Property::Boolean) do end
On puppet run when 'is' value is true and 'should' value is false, the insync? is never invoked and puppet does not change the value of the property!
I think the problem is here https://github.com/puppetlabs/puppet/blob/main/lib/puppet/property.rb#L274 When @should is false at this point safe_insync? never invoke insync?
safe_insync?
insync?
I would expect puppet to change the value from true to false
The text was updated successfully, but these errors were encountered:
I'm not sure, but would this fix be enough? return true if @should.nil?
return true if @should.nil?
Sorry, something went wrong.
This is https://perforce.atlassian.net/browse/PUP-2368 for properties and https://perforce.atlassian.net/browse/PUP-8442 for parameters. We tried to fix parameters before and caused a regression in the vcs module which caused repos to be forceable deleted, so the fix needs to be opt-in.
There are likely several places where puppet conflates false and nil such as the transaction, resource_harness and events/reports.
false
nil
The workaround is to use symbols :true :false as described in https://dev.to/betadots/the-ruby-side-of-puppet-part-3-custom-types-and-providers-4hma
:true
:false
No branches or pull requests
Describe the Bug
I have a custom type with a boolean property defined as
On puppet run when 'is' value is true and 'should' value is false, the insync? is never invoked and puppet does not change the value of the property!
I think the problem is here https://github.com/puppetlabs/puppet/blob/main/lib/puppet/property.rb#L274
When @should is false at this point
safe_insync?
never invokeinsync?
Expected Behavior
I would expect puppet to change the value from true to false
The text was updated successfully, but these errors were encountered: