Bug #20580
closed"hammer host-collection list --host" produce error 500 - undefined method `order'
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1479284
Description of problem:
When filtering `hammer host-collection list` by host (both --host-id and --host), it fails with 500 error and message 'undefined method `order' for #<Array:0x00000014c20740>'
- hammer -d -v -u admin -p changeme host-collection list --host-id="2"
[ INFO 2017-08-08 04:45:09 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2017-08-08 04:45:09 HammerCLIKatello::HostCollection] Called with options: {}
[ INFO 2017-08-08 04:45:09 HammerCLIKatello::HostCollection::ListCommand] Called with options: {"option_host_id"=>2}
[ INFO 2017-08-08 04:45:09 API] Server: https://intel-wildcatpass-05.khw.lab.eng.bos.redhat.com
[ INFO 2017-08-08 04:45:09 API] GET /katello/api/host_collections
[DEBUG 2017-08-08 04:45:09 API] Params: {
"page" => 1,
"per_page" => 1000,
"sort" => {},
"host_id" => 2
}
[DEBUG 2017-08-08 04:45:09 API] Headers: {
:params => {
"page" => 1,
"per_page" => 1000,
"sort" => {},
"host_id" => 2
}
}
[DEBUG 2017-08-08 04:45:09 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[ERROR 2017-08-08 04:45:09 API] 500 Internal Server Error
[DEBUG 2017-08-08 04:45:09 API] {
"displayMessage" => "undefined method `order' for #<Array:0x007f10606de008>",
"errors" => [
[0] "undefined method `order' for #<Array:0x007f10606de008>"
]
}
Satellite 6.3 Snap 10:
- satellite-6.3.0-16.0.beta.el7sat.noarch
- foreman-1.15.2-1.el7sat.noarch
- katello-3.4.4-2.el7sat.noarch
- tfm-rubygem-hammer_cli_foreman-0.10.2-1.el7sat.noarch
- tfm-rubygem-hammer_cli_katello-0.10.0-1.el7sat.noarch
How reproducible:
Always
Steps to Reproduce:
1. Create host
2. Create host collection
3. Add host to that host collection
4. List host collections and filter by that host, like:
hammer -d -v host-collection list --host-id="2"
Actual results:
500 error
Expected results:
Host collections should be listed