Throwe, Jesse
2012-Feb-22 13:45 UTC
[Puppet Users] Unexpected behavior with booleans and inventory service
I''ve been working on querying the inventory service in puppet and ran across a behavior that does not appear to be documented anywhere. I wanted to check to verify this is not a bug before documenting it somewhere. In the inventory service, examining the facts on a node returns a value of "true" or "false". For instance, is_virtual: "true". However, when querying the inventory service for nodes that have a boolean defined as either true or false, searching a boolean for "true" returns nothing, and "false" returns all values where this is defined. $ curl -k -3 -H "Accept: yaml" https://puppet:8140/production/facts_search/search?facts.is_virtual=true --- [] $ curl -k -3 -H "Accept: yaml" https://puppet:8140/production/facts_search/search?facts.is_virtual=false --- <long list of both virtual and physical servers> If the value given is "TRUE" or "FALSE" the search works as intended. $ curl -k -3 -H "Accept: yaml" https://puppet:8140/production/facts_search/search?facts.is_virtual=TRUE --- <long list of only virtual servers> $ curl -k -3 -H "Accept: yaml" https://puppet:8140/production/facts_search/search?facts.is_virtual=FALSE --- <long list of only physical servers> Neither the inventory service documentation or the REST API documentation seem to describe this behavior, ergo the reason I am unsure if this is a bug or expected behavior. This is running against puppet 2.6.12. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.