-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
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
Datasource always change state, if there is a number in it. #97
Comments
Try alphabetizing your keys. |
It makes no difference. |
Here is some debug info: I have currently "fixed" this by adding this, to the "insync?" method. is.each do |k,v|
if ( v.is_a? Integer )
is[k]=v.to_s
end
end |
I have encountered the same problem, INT/LONG values in "should" are quoted but the "is" values are not, resulting in insync always returning false. This is not a datasource only problem, it happens on any resource where you try to and enforce state that includes INT/LONG values using the wildfly_resource type. |
I'll investigate this tonight. Could you (@icetrain @lasse-kristensen) provide more information about your environment? (Ruby version, Puppet version, module version and etc) |
Hey |
ruby --version: ruby 2.0.0p598 (2014-11-13) [x86_64-linux] |
Fact: Puppet custom types checks current state (Is) against desirable state (Should). Wildfly HTTP API returns a JSON representation of a resource (Is) and if one its properties is a number, a number is returned. User provides a Hash representation (Should) of a resource in any form, but generally a string representation. If the user provided a string representation of a number property, this issue will happen. e.g.
instead of:
I changed custom type to ignore types (convert everything to strings), but if you change number properties to number literals you'll might get the same outcome. |
* upstream: Support any service name in RHEL7 based distros. Fix issue voxpupuli#102. Manage interfaces using augeas for versions < 8.2.1. Fix issue voxpupuli#97. Convert everything to string before state verification. Fix issue voxpupuli#101. Add wildfly.service file in RHEL7 base OSs.
Please re-open this issue. This 'fix' breaks recursive resources!!! |
It's back, at least for booleans: |
Another fix for #97, stringify true/false
I've made a wildfly datasource, where some config keys have number in.
'min-pool-size' => 1,
'max-pool-size' => 10,
It configure it right, but every puppet run it tells me that state changed.
/state: state changed '{"max-pool-size"=>10, "min-pool-size"=>1}' to '{"min-pool-size"=>"1", "max-pool-size"=>"10"}'
The text was updated successfully, but these errors were encountered: