Bug 1379372 - hammer host-collection list fails to retrieve list when searching for a host.
Summary: hammer host-collection list fails to retrieve list when searching for a host.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.2.2
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: Chris Roberts
QA Contact: Sanket Jagtap
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1394379
TreeView+ depends on / blocked
 
Reported: 2016-09-26 13:44 UTC by mlinden
Modified: 2020-09-10 09:49 UTC (History)
9 users (show)

Fixed In Version: tfm-rubygem-hammer_cli_katello-0.0.22.28-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1394379 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 16708 0 Normal Closed hammer host-collection list fails to retrieve list when searching for a host 2020-10-08 21:27:23 UTC

Description mlinden 2016-09-26 13:44:43 UTC
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.


Additional info:
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>'

Comment 2 Bryan Kearney 2016-09-27 18:19:02 UTC
Upstream bug component is API

Comment 3 Bryan Kearney 2016-09-28 08:18:43 UTC
Upstream bug component is Content Management

Comment 4 Bryan Kearney 2016-10-04 14:21:15 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16708 has been resolved.

Comment 6 Sanket Jagtap 2016-10-21 08:12:27 UTC
Build: Satellite 6.3 snap 5

Steps
Katello-version

rpm -qa | grep katello
katello-service-3.2.0-2.rc2.el7.noarch
tfm-rubygem-hammer_cli_katello-0.1.0-1.el7.noarch
katello-common-3.2.0-2.rc2.el7.noarch
katello-server-ca-1.0-1.noarch
katello-client-bootstrap-1.1.0-2.el7sat.noarch
tfm-rubygem-katello_ostree-3.2.0-0.2.rc2.el7.noarch
foreman-installer-katello-3.2.0-2.rc2.el7.noarch
pulp-katello-1.0.2-1.el7.noarch
tfm-rubygem-katello-3.2.0-0.2.rc2.el7.noarch
katello-default-ca-1.0-1.noarch
katello-certs-tools-2.4.0-1.el7sat.noarch
katello-selinux-3.0.1.2-1.el7sat.noarch
katello-3.2.0-2.rc2.el7.noarch
katello-debug-3.2.0-2.rc2.el7.noarch
katello-installer-base-3.2.0-2.rc2.el7.noarch


hammer> host-collection hosts --name mycollection --organization-id 1
---|------------------------------------------------
ID | NAME
---|------------------------------------------------
2  | angie-kobis.abc.redhat.com
4  | jose-felts.abc.redhat.com
3  | julia-altken.abc.redhat.com
---|------------------------------------------------

Searching for particular host returns no value

Welcome to the hammer interactive shell
Type 'help' for usage information
hammer> host-collection list --host angie-kobis.abc.redhat.com  --organization-id 1

hammer>

Additional information:
Running the command using debug option

hammer -u admin -p changeme --debug host-collection list --host angie-kobis.abc.redhat.com --organization-id 1
[ INFO 2016-10-21 04:07:13 Init] Initialization of Hammer CLI (0.8.0) has started...
[DEBUG 2016-10-21 04:07:13 Init] Running at ruby 2.2.2-p95
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-10-21 04:07:13 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-10-21 04:07:13 Connection] Registered: foreman
[DEBUG 2016-10-21 04:07:13 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[DEBUG 2016-10-21 04:07:13 API] Follow redirects: never
[ INFO 2016-10-21 04:07:13 Modules] Extension module hammer_cli_foreman (0.8.0) loaded
[ INFO 2016-10-21 04:07:13 Modules] Extension module hammer_cli_foreman_admin (0.0.5) loaded
[ INFO 2016-10-21 04:07:13 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded
[ INFO 2016-10-21 04:07:13 Modules] Extension module hammer_cli_foreman_discovery (0.0.3) loaded
[ INFO 2016-10-21 04:07:13 Modules] Extension module hammer_cli_import (0.11.3) loaded
[ INFO 2016-10-21 04:07:13 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-10-21 04:07:13 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-10-21 04:07:14 Modules] Extension module hammer_cli_katello (0.1.0) loaded
[DEBUG 2016-10-21 04:07:14 Init] Using locale 'en'
[DEBUG 2016-10-21 04:07:14 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/locale'
[DEBUG 2016-10-21 04:07:14 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.8.0/locale'
[DEBUG 2016-10-21 04:07:14 Init] 'mo' files for locale domain 'hammer-cli-csv' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_csv-2.1.2/locale'
[DEBUG 2016-10-21 04:07:14 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-10-21 04:07:14 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.1.0/locale'
[ INFO 2016-10-21 04:07:14 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ WARN 2016-10-21 04:07:14 HammerCLIKatello::HostCollection::ContentBaseCommand] Resource 'systems_bulk_actions' does not exist in the API
[ INFO 2016-10-21 04:07:14 HammerCLIKatello::HostCollection] Called with options: {}
[ INFO 2016-10-21 04:07:14 HammerCLIKatello::HostCollection::ListCommand] Called with options: {"option_organization_id"=>1, "option_host_name"=>"angie-kobis.abc.redhat.com"}
[ INFO 2016-10-21 04:07:14 API] Server: https://localhost/
[ INFO 2016-10-21 04:07:14 API] GET /api/hosts
[DEBUG 2016-10-21 04:07:14 API] Params: {
    :search => "name = \"angie-kobis.abc.redhat.com\""
}
[DEBUG 2016-10-21 04:07:14 API] Headers: {
    :params => {
        :search => "name = \"angie-kobis.abc.redhat.com\""
    }
}
[DEBUG 2016-10-21 04:07:14 API] Response: {
       "total" => 4,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
      "search" => "name = \"angie-kobis.abc.redhat.com\"",
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                                       "ip" => "192.168.1.21",
                                      "ip6" => "",
                           "environment_id" => 1,
                         "environment_name" => "production",
                              "last_report" => "2016-10-21 07:38:40 UTC",
                                      "mac" => nil,
                                 "realm_id" => nil,
                               "realm_name" => nil,
                                   "sp_mac" => nil,
                                    "sp_ip" => nil,
                                  "sp_name" => nil,
                                "domain_id" => 2,
                              "domain_name" => "abc.redhat.com",
                          "architecture_id" => 1,
                        "architecture_name" => "x86_64",
                       "operatingsystem_id" => 1,
                     "operatingsystem_name" => "RedHat 7.2",
                                "subnet_id" => 1,
                              "subnet_name" => "subnetstack",
                               "subnet6_id" => nil,
                             "subnet6_name" => nil,
                             "sp_subnet_id" => nil,
                                "ptable_id" => 80,
                              "ptable_name" => "Kickstart default",
                                "medium_id" => nil,
                              "medium_name" => nil,
                                    "build" => false,
                                  "comment" => "",
                                     "disk" => "",
                             "installed_at" => "2016-10-21 06:29:47 UTC",
                                 "model_id" => 2,
                             "hostgroup_id" => 1,
                                 "owner_id" => 3,
                               "owner_type" => "User",
                                  "enabled" => true,
                       "puppet_ca_proxy_id" => 1,
                                  "managed" => true,
                                "use_image" => nil,
                               "image_file" => "",
                                     "uuid" => "24d099e2-a36e-4804-8efd-88f10689e762",
                      "compute_resource_id" => 1,
                    "compute_resource_name" => "openstack",
                       "compute_profile_id" => 2,
                     "compute_profile_name" => "2-Medium",
                             "capabilities" => [
                [0] "image"
            ],
                         "provision_method" => "image",
                          "puppet_proxy_id" => 1,
                                 "certname" => "angie-kobis.abc.redhat.com",
                                 "image_id" => 1,
                               "image_name" => "rhel72base",
                               "created_at" => "2016-10-21 06:29:04 UTC",
                               "updated_at" => "2016-10-21 07:38:45 UTC",
                             "last_compile" => "2016-10-21 07:38:42 UTC",
                            "global_status" => 2,
                      "global_status_label" => "Error",
                          "organization_id" => 1,
                        "organization_name" => "Default Organization",
                              "location_id" => 2,
                            "location_name" => "Default Location",
                            "puppet_status" => 0,
                               "model_name" => "OpenStack Compute",
                     "configuration_status" => 0,
               "configuration_status_label" => "No changes",
                             "build_status" => 0,
                       "build_status_label" => "Installed",
                        "compliance_status" => 2,
                  "compliance_status_label" => "Incompliant",
                            "errata_status" => 0,
                      "errata_status_label" => "All errata applied",
                      "subscription_status" => 0,
                "subscription_status_label" => "Fully entitled",
                                     "name" => "angie-kobis.abc.redhat.com",
                                       "id" => 2,
                           "hostgroup_name" => "rhel7_hstgrp",
                          "hostgroup_title" => "rhel7_hstgrp",
                 "content_facet_attributes" => {
                                        "id" => 1,
                                      "uuid" => "ce9f0494-459d-4190-be61-005679f21492",
                           "content_view_id" => 2,
                         "content_view_name" => "rhel7_cv",
                  "lifecycle_environment_id" => 2,
                "lifecycle_environment_name" => "Dev",
                              "content_view" => {
                      "id" => 2,
                    "name" => "rhel7_cv"
                },
                     "lifecycle_environment" => {
                      "id" => 2,
                    "name" => "Dev"
                },
                             "errata_counts" => {
                       "security" => 0,
                         "bugfix" => 0,
                    "enhancement" => 0,
                          "total" => 0
                }
            },
               "subscription_global_status" => 0,
            "subscription_facet_attributes" => {
                                "id" => 1,
                              "uuid" => "ce9f0494-459d-4190-be61-00c8e9f21492",
                      "last_checkin" => "2016-10-21 06:31:57 UTC",
                     "service_level" => nil,
                   "release_version" => nil,
                          "autoheal" => true,
                     "registered_at" => "2016-10-21 06:29:23 UTC",
                "registered_through" => "sjagtap-sat6.abc.com"
            }
        }
    ]
}
[DEBUG 2016-10-21 04:07:14 API] Response headers: {
                      :date => "Fri, 21 Oct 2016 08:07:14 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.13.0",
       :foreman_api_version => "2",
           :apipie_checksum => "2df759e92b3e90ef0dd185f15da243567",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "c7425c5f-8436-44be-99c2-d0b372dff966",
                 :x_runtime => "0.186146",
              :x_powered_by => "Phusion Passenger 4.0.53",
                :set_cookie => [
        [0] "_session_id=93d805a2023aa4c28859a70408aa56a9; path=/; secure; HttpOnly"
    ],
                      :etag => "W/\"37b7dbfa2f7bd12492a7caac8da7fc2c-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "1077",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-10-21 04:07:14 API] Server: https://localhost/
[ INFO 2016-10-21 04:07:14 API] GET /katello/api/hosts/2/host_collections
[DEBUG 2016-10-21 04:07:14 API] Params: {
               "page" => 1,
           "per_page" => 1000,
               "sort" => {},
    "organization_id" => 1
}
[DEBUG 2016-10-21 04:07:14 API] Headers: {
    :params => {
                   "page" => 1,
               "per_page" => 1000,
                   "sort" => {},
        "organization_id" => 1
    }
}
[ERROR 2016-10-21 04:07:14 API] 404 Resource Not Found
[DEBUG 2016-10-21 04:07:14 API] {
    "status" => "404",
     "error" => "Not Found"
}
[ERROR 2016-10-21 04:07:14 Exception] <NilClass> nil

[ERROR 2016-10-21 04:07:14 Exception]

RestClient::ResourceNotFound (404 Resource Not Found):
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:312:in `block in rest_client_call_block'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421: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.8.0/lib/restclient/request.rb:413:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:51:in `get'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:293:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:222:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:172:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:167:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/resource.rb:21:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.8.0/lib/hammer_cli_foreman/commands.rb:190:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.8.0/lib/hammer_cli_foreman/commands.rb:280:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.8.0/lib/hammer_cli_foreman/commands.rb:315:in `retrieve_all'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.8.0/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.8.0/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.8.0/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.8.0/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.8.0/bin/hammer:125:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Comment 7 Chris Roberts 2016-10-31 08:07:05 UTC
Works for me on nightly, moving back to ON_QA:

[root@centos7-katello-nightly ~]# hammer shell
Welcome to the hammer interactive shell
Type 'help' for usage information
hammer> organization list
[Foreman] Password for admin: 
---|----------------------|-------------|----------------------|------------
ID | NAME                 | DESCRIPTION | LABEL                | DESCRIPTION
---|----------------------|-------------|----------------------|------------
1  | Default Organization |             | Default_Organization |            
---|----------------------|-------------|----------------------|------------
hammer> host-collection list --host rhel7.example.com --organization-id 1
---|-----------------|-------|------------
ID | NAME            | LIMIT | DESCRIPTION
---|-----------------|-------|------------
1  | test-collection | None  |            
---|-----------------|-------|------------
hammer> host-collection hosts --name test-collection --organization-id 1
---|------------------
ID | NAME             
---|------------------
3  | rhel7.example.com
---|------------------
hammer> host-collection list --host rhel7.example.com --organization-id 1
---|-----------------|-------|------------
ID | NAME            | LIMIT | DESCRIPTION
---|-----------------|-------|------------
1  | test-collection | None  |            
---|-----------------|-------|------------

Comment 8 Sanket Jagtap 2016-12-06 12:45:02 UTC
Build: Satellite 6.2.5 snap2

hammer> host-collection hosts --name mycollection --organization-id 1
---|------------------------------------
ID | NAME
---|------------------------------------
2  | sjag1.abc.com
3  | sjag2.abc.com
4  | sjag3.abc.com
---|------------------------------------
hammer> host-collection list --host sjag2.abc.com --organization-id 1
---|--------------|-------|------------
ID | NAME         | LIMIT | DESCRIPTION
---|--------------|-------|------------
1  | mycollection | None  |
---|--------------|-------|------------

Comment 9 Bryan Kearney 2016-12-12 18:48:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:2940

Comment 10 Bryan Kearney 2016-12-12 18:48:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:2940


Note You need to log in before you can comment on or make changes to this bug.