Actions
Bug #1651
closedforemancli fails on fact_values queries
Description
$ foremancli -s https://foreman.example.com --fact_values 'fact.name = operatingsystem' /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:185:in `print_response': undefined method `join' for #<Hash:0x7fb33b963598> (NoMethodError) from /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:194 from /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:189:in `each' from /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:189 from /usr/local/bin/foremancli:19:in `load' from /usr/local/bin/foremancli:19
Debug Output:
$ foremancli -ds https://foreman.example.com --fact_values 'fact.name = operatingsystem' RestClient.get "https://foreman.example.com/fact_values?search=fact.name%20=%20operatingsystem", "Accept"=>"application/json", "Accept-Encoding"=>"gzip, deflate", "Content-Type"=>"application/json" # => 200 OK | application/json 14936 bytes /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:185:in `print_response': undefined method `join' for #<Hash:0x7ff91b0fec10> (NoMethodError) from /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:194 from /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:189:in `each' from /var/lib/gems/1.8/gems/foremancli-0.4.1/bin/foremancli:189 from /usr/local/bin/foremancli:19:in `load' from /usr/local/bin/foremancli:19
Looks like the output here is an array of nested hashes, and the output filter is choking on it?
-torrancew
Updated by Brian Gupta over 12 years ago
Ok did a quick test. Looks like if you specify a --json or --yaml flag it works. What would you like the ideal default behavior to be?
Thanks,
Brian
Updated by Brian Gupta over 12 years ago
Thinking more about it... and remembering that there are a number of collections that don't work without a format flag (--json or --yaml). Since we are addressing this in hammer, by setting a default format, and allowed formats for each collection, I am inclined not to address this in foremancli.
Thoughts?
Updated by Martin Bacovsky over 11 years ago
- Description updated (diff)
- Status changed from New to Rejected
This will be resolved by new Hammer (CLI). This bug was untouched for a year, closing it as a 'won't fix'.
If this is still important feel free to reopen the bug.
Updated by Dominic Cleal about 11 years ago
- Project changed from Foreman to Hammer CLI
- Category deleted (
44)
Actions