In a custom type/provider I am writing it seems that the provider is not 
entirely idempotent.

The provider 
(https://github.com/kemra102/puppet-githubapi/blob/master/lib/puppet/provider/github_repo/default.rb)
 
is calling the Github API (https://developer.github.com/v3/repos/#edit) and 
amending an attribute that is a boolean on the API side is what is causing 
the issue.

The API always returns a boolean value as expected however the Puppet 
provider converts the boolean value provided to a symbol and presumably it 
is this that is causing the value to always be modified even if for example 
it is already the value specified in the resource.

Notice: Compiled catalog for iacon.cybertron.local in environment 
production in 0.06 seconds
FalseClass
{"name"=>"apitest", "has_wiki"=>:false}
Symbol
Notice: /Stage[main]/Main/Github_repo[apitest]/has_wiki: has_wiki changed 
'false' to 'false'
Notice: Finished catalog run in 2.51 seconds

In the above I added some cheap and dirty debugging which shows;

FalseClass = This is the value returned by the GitHub API.
{"name"=>"apitest", "has_wiki"=>:false} - The values being sent in the body 
of the request to the GitHub API.
Symbol - As is probably clear this is the class of the 'has_wiki' value.

Any ideas how to correctly match up these values and not cause an 
unrequired update?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b847246d-13d1-4f00-8058-6cc71567e908%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to