Bug #16708
closedhammer host-collection list fails to retrieve list when searching for a host
Description
Description of problem:
hammer host-collection list fails to retrieve list when searching for a host.
Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli_foreman_docker-0.0.6-1.el7sat.noarch
tfm-rubygem-hammer_cli_csv-2.1.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.10.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_discovery-0.0.2.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.5.1.9-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_admin-0.0.5-1.el7sat.noarch
tfm-rubygem-hammer_cli-0.5.1.11-4.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.5.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.0.22.26-1.el7sat.noarch
tfm-rubygem-hammer_cli_import-0.11.2-1.el7sat.noarch
How reproducible:
Always
Steps to Reproduce:
1. Search for a hostname that exists in a host-collection
hammer host-collection list --host mgmt.local.lan --organization-id 1
2. Nothing is returned.
Actual results:
Nothing is returned.
Expected results:
hammer should return the list of host-collections the host exists in.
Running the same command with --debug
- hammer --debug host-collection list --host mgmt.orb.local.lan --organization-id 1
[ INFO 2016-09-26 15:38:46 Init] Initialization of Hammer CLI (0.5.1.11) has started...
[DEBUG 2016-09-26 15:38:46 Init] Running at ruby 2.2.2-p95
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-09-26 15:38:46 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-09-26 15:38:46 Connection] Registered: foreman
[DEBUG 2016-09-26 15:38:46 API] Global headers: {
:content_type => "application/json",
:accept => "application/json;version=2",
"Accept-Language" => "en_GB"
}
[DEBUG 2016-09-26 15:38:46 API] Follow redirects: never
[ INFO 2016-09-26 15:38:46 Modules] Extension module hammer_cli_foreman (0.5.1.9) loaded
[ INFO 2016-09-26 15:38:46 Modules] Extension module hammer_cli_foreman_admin (0.0.5) loaded
[ INFO 2016-09-26 15:38:46 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded
[ INFO 2016-09-26 15:38:46 Modules] Extension module hammer_cli_foreman_discovery (0.0.2.3) loaded
[ INFO 2016-09-26 15:38:46 Modules] Extension module hammer_cli_import (0.11.2) loaded
[ INFO 2016-09-26 15:38:47 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-09-26 15:38:47 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-09-26 15:38:47 Modules] Extension module hammer_cli_katello (0.0.22.26) loaded
[DEBUG 2016-09-26 15:38:47 Init] Using locale 'en_GB'
[DEBUG 2016-09-26 15:38:47 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/locale'
[DEBUG 2016-09-26 15:38:47 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.9/locale'
[DEBUG 2016-09-26 15:38:47 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.6/locale'
[DEBUG 2016-09-26 15:38:47 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.26/locale'
[ INFO 2016-09-26 15:38:47 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ WARN 2016-09-26 15:38:47 HammerCLIKatello::HostCollection::ContentBaseCommand] Resource 'systems_bulk_actions' does not exist in the API
[ INFO 2016-09-26 15:38:47 HammerCLIKatello::HostCollection] Called with options: {}
[ INFO 2016-09-26 15:38:47 HammerCLIKatello::HostCollection::ListCommand] Called with options: {"option_organization_id"=>1, "option_host_name"=>"mgmt.orb.local.lan"}
[ INFO 2016-09-26 15:38:47 API] Server: https://localhost/
[ INFO 2016-09-26 15:38:47 API] GET /api/hosts
[DEBUG 2016-09-26 15:38:47 API] Params: {
:search => "name = \"mgmt.orb.local.lan\""
}
[DEBUG 2016-09-26 15:38:47 API] Headers: {
:params => {
:search => "name = \"mgmt.orb.local.lan\""
}
}
[DEBUG 2016-09-26 15:38:48 API] Response: {
"total" => 10,
"subtotal" => 1,
"page" => 1,
"per_page" => 20,
"search" => "name = \"mgmt.orb.local.lan\"",
"sort" => {
"by" => nil,
"order" => nil
},
"results" => [
[0] {
"ip" => "192.168.101.104",
"environment_id" => 1,
"environment_name" => "production",
"last_report" => "2016-06-06 22:28:55 UTC",
"mac" => "00:1a:4a:a8:32:04",
"realm_id" => nil,
"realm_name" => nil,
"sp_mac" => nil,
"sp_ip" => nil,
"sp_name" => nil,
"domain_id" => 2,
"domain_name" => "orb.local.lan",
"architecture_id" => 1,
"architecture_name" => "x86_64",
"operatingsystem_id" => 1,
"operatingsystem_name" => "RedHat 7.2",
"subnet_id" => 1,
"subnet_name" => "Orb subnet",
"sp_subnet_id" => nil,
"ptable_id" => 58,
"ptable_name" => "Kickstart default",
"medium_id" => 7,
"medium_name" => "redhat/Library/Red_Hat_Server/Red_Hat_Enterprise_Linux_7_Server_Kickstart_x86_64_7_2",
"build" => false,
"comment" => "",
"disk" => "",
"installed_at" => "2016-02-09 12:06:13 UTC",
"model_id" => 2,
"hostgroup_id" => 1,
"owner_id" => 3,
"owner_type" => "User",
"enabled" => true,
"puppet_ca_proxy_id" => 3,
"managed" => true,
"use_image" => nil,
"image_file" => "",
"uuid" => "9c0cbb21-c2f2-43af-802a-ac59e625d6ee",
"compute_resource_id" => 1,
"compute_resource_name" => "rhevm.local.lan",
"compute_profile_id" => nil,
"compute_profile_name" => nil,
"capabilities" => [
[0] "build",
[1] "image"
],
"provision_method" => "build",
"puppet_proxy_id" => 3,
"certname" => "mgmt.orb.local.lan",
"image_id" => nil,
"image_name" => nil,
"created_at" => "2016-02-09 11:37:02 UTC",
"updated_at" => "2016-08-22 13:42:48 UTC",
"last_compile" => "2016-08-22 13:42:44 UTC",
"global_status" => 0,
"global_status_label" => "Error",
"organization_id" => 1,
"organization_name" => "redhat",
"location_id" => 2,
"location_name" => "orb",
"puppet_status" => 0,
"model_name" => "RHEV Hypervisor",
"configuration_status" => 0,
"configuration_status_label" => "No reports",
"build_status" => 0,
"build_status_label" => "Installed",
"errata_status" => 3,
"errata_status_label" => "Security errata applicable",
"subscription_status" => 0,
"subscription_status_label" => "Fully entitled",
"name" => "mgmt.orb.local.lan",
"id" => 19,
"hostgroup_name" => "rhel7-standard",
"hostgroup_title" => "rhel7-standard",
"content_facet_attributes" => {
"id" => 4,
"uuid" => "c1ed0499-2f7e-4ece-b6e1-13def0f4984e",
"content_view_id" => 1,
"content_view_name" => "Default Organization View",
"lifecycle_environment_id" => 1,
"lifecycle_environment_name" => "Library",
"content_view" => {
"id" => 1,
"name" => "Default Organization View"
},
"lifecycle_environment" => {
"id" => 1,
"name" => "Library"
},
"errata_counts" => {
"security" => 12,
"bugfix" => 46,
"enhancement" => 4,
"total" => 62
}
},
"subscription_facet_attributes" => {
"id" => 3,
"uuid" => "c1ed0499-2f7e-4ece-b6e1-13def0f4984e",
"last_checkin" => "2016-06-08 08:28:53 UTC",
"service_level" => nil,
"release_version" => nil,
"autoheal" => true,
"registered_at" => "2016-02-09 12:00:08 UTC"
},
"content_host_id" => 22
}
]
}
[DEBUG 2016-09-26 15:38:48 API] Response headers: {
:date => "Mon, 26 Sep 2016 13:38:47 GMT",
:server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
:x_frame_options => "SAMEORIGIN",
:x_xss_protection => "1; mode=block",
:x_content_type_options => "nosniff",
:foreman_version => "1.11.0.53",
:foreman_api_version => "2",
:apipie_checksum => "4a9fe625e9e536d89c3db2ffe418ad68",
:cache_control => "max-age=0, private, must-revalidate",
:x_request_id => "33f59582-27c7-4aaa-a5c5-9314e400823d",
:x_runtime => "0.195574",
:x_powered_by => "Phusion Passenger 4.0.18",
:set_cookie => [
[0] "_session_id=3fe71bb2452eab57004014f423cb72f2; path=/; secure; HttpOnly"
],
:etag => "\"6cde57ba2fb9b6313d107277b39fb97a-gzip\"",
:status => "200 OK",
:vary => "Accept-Encoding",
:content_encoding => "gzip",
:content_length => "1090",
:content_type => "application/json; charset=utf-8"
}
[ INFO 2016-09-26 15:38:48 API] Server: https://localhost/
[ INFO 2016-09-26 15:38:48 API] GET /katello/api/hosts/19/host_collections
[DEBUG 2016-09-26 15:38:48 API] Params: {
"page" => 1,
"per_page" => 1000,
"sort" => {},
"organization_id" => 1
}
[DEBUG 2016-09-26 15:38:48 API] Headers: {
:params => {
"page" => 1,
"per_page" => 1000,
"sort" => {},
"organization_id" => 1
}
}
[DEBUG 2016-09-26 15:38:48 API] 404 Resource Not Found {
"status" => "404",
"error" => "Not Found"
}
[ERROR 2016-09-26 15:38:48 Exception] <NilClass> nil
[ERROR 2016-09-26 15:38:48 Exception]
RestClient::ResourceNotFound (404 Resource Not Found):
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:308:in `block in rest_client_call_block'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:51:in `get'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:295:in `call_client'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:224:in `http_call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:174:in `call_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:169:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/resource.rb:14:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/apipie/command.rb:43:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.9/lib/hammer_cli_foreman/commands.rb:190:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.9/lib/hammer_cli_foreman/commands.rb:280:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.9/lib/hammer_cli_foreman/commands.rb:315:in `retrieve_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.9/lib/hammer_cli_foreman/commands.rb:299:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/bin/hammer:125:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'
Updated by The Foreman Bot over 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/6348 added
Updated by The Foreman Bot over 8 years ago
- Pull request https://github.com/Katello/hammer-cli-katello/pull/455 added
Updated by Dominic Cleal over 8 years ago
- Project changed from Foreman to Katello
- Category deleted (
API)
Updated by Justin Sherrill over 8 years ago
- Translation missing: en.field_release set to 162
Updated by The Foreman Bot about 8 years ago
- Pull request https://github.com/Katello/hammer-cli-katello/pull/457 added
Updated by Anonymous about 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset hammer-cli-katello|51633c7370ea5c91ee00f20dac39d2886c425f4e.
Updated by The Foreman Bot about 8 years ago
- Pull request https://github.com/Katello/hammer-cli-katello/pull/465 added