Bug 1122188 - CLI command lifecycle-environment paths generates error
Summary: CLI command lifecycle-environment paths generates error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: Katello Bug Bin
QA Contact: Tazim Kolhar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-22 18:03 UTC by Og Maciel
Modified: 2017-02-23 21:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:11:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1592 0 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC

Description Og Maciel 2014-07-22 18:03:24 UTC
Description of problem:

The following CLI command generates an error:

# hammer -u zumx59 -p s9w3 -v -d lifecycle-environment paths --organization 'mbZKYjhB'
Error: can't convert String into Integer


Version-Release number of selected component (if applicable):

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.19-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.19-1.el6_5.noarch
* candlepin-tomcat6-0.9.19-1.el6_5.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.6.0.29-1.el6sat.noarch
* foreman-compute-1.6.0.29-1.el6sat.noarch
* foreman-gce-1.6.0.29-1.el6sat.noarch
* foreman-libvirt-1.6.0.29-1.el6sat.noarch
* foreman-ovirt-1.6.0.29-1.el6sat.noarch
* foreman-postgresql-1.6.0.29-1.el6sat.noarch
* foreman-proxy-1.6.0.21-1.el6sat.noarch
* foreman-selinux-1.6.0-8.el6sat.noarch
* foreman-vmware-1.6.0.29-1.el6sat.noarch
* katello-1.5.0-27.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-installer-0.0.56-1.el6sat.noarch
* openldap-2.4.23-32.el6_4.1.x86_64
* pulp-katello-0.3-3.el6sat.noarch
* pulp-nodes-common-2.4.0-0.23.beta.el6sat.noarch
* pulp-nodes-parent-2.4.0-0.23.beta.el6sat.noarch
* pulp-puppet-plugins-2.4.0-0.23.beta.el6sat.noarch
* pulp-puppet-tools-2.4.0-0.23.beta.el6sat.noarch
* pulp-rpm-plugins-2.4.0-0.23.beta.el6sat.noarch
* pulp-selinux-2.4.0-0.23.beta.el6sat.noarch
* pulp-server-2.4.0-0.23.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch
* rubygem-hammer_cli-0.1.1-10.el6sat.noarch
* rubygem-hammer_cli_foreman-0.1.1-12.el6sat.noarch
* rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch
* rubygem-hammer_cli_katello-0.0.4-8.el6sat.noarch

How reproducible:


Steps to Reproduce:
1. Use the lifecycle-environment paths command via the CLI
2.
3.

Actual results:

Error is being raised

Expected results:


Additional info:

# hammer -u zumx59 -p s9w3 -v -d lifecycle-environment paths --organization 'mbZKYjhB'
[ INFO 2014-07-22 11:46:03 Init] Initialization of Hammer CLI (0.1.1) has started...
[DEBUG 2014-07-22 11:46:03 Init] Running at ruby 1.8.7-p352
[ INFO 2014-07-22 11:46:03 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2014-07-22 11:46:03 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2014-07-22 11:46:03 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2014-07-22 11:46:03 Connection] Registered: foreman
[DEBUG 2014-07-22 11:46:03 API] Global headers: {
    "Accept-Language" => "en",
        :content_type => "application/json",
              :accept => "application/json;version=2"
}
[ INFO 2014-07-22 11:46:04 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2014-07-22 11:46:04 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2014-07-22 11:46:04 Modules] Extension module hammer_cli_katello (0.0.4) loaded
[ INFO 2014-07-22 11:46:04 Modules] Extension module hammer_cli_foreman (0.1.1) loaded
[DEBUG 2014-07-22 11:46:04 Init] Using locale 'en'
[DEBUG 2014-07-22 11:46:04 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale'
[DEBUG 2014-07-22 11:46:04 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale'
[DEBUG 2014-07-22 11:46:04 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/locale'
[ INFO 2014-07-22 11:46:04 HammerCLI::MainCommand] Called with options: {"option_password"=>"***", "option_username"=>"zumx59", "option_verbose"=>true, "option_debug"=>true}
[ INFO 2014-07-22 11:46:04 HammerCLIKatello::LifecycleEnvironmentCommand] Called with options: {}
[ INFO 2014-07-22 11:46:04 HammerCLIKatello::LifecycleEnvironmentCommand::PathsCommand] Called with options: {"option_organization_name"=>"mbZKYjhB"}
[ INFO 2014-07-22 11:46:04 API] GET /katello/api/organizations
[DEBUG 2014-07-22 11:46:04 API] Params: {
    :search => "name = \"mbZKYjhB\""
}
[DEBUG 2014-07-22 11:46:04 API] Headers: {
    :params => {
        :search => "name = \"mbZKYjhB\""
    }
}
[DEBUG 2014-07-22 11:46:04 API] Response {
     "results" => [
        [0] {
                  "label" => "mbZKYjhB",
                  "title" => "mbZKYjhB",
             "created_at" => "2014-07-21T20:01:08Z",
                   "name" => "mbZKYjhB",
                     "id" => 14,
             "updated_at" => "2014-07-21T20:03:41Z",
            "description" => nil
        }
    ],
        "sort" => {
           "by" => nil,
        "order" => nil
    },
    "subtotal" => 1,
        "page" => 1,
       "total" => 13,
      "search" => "name = \"mbZKYjhB\"",
    "per_page" => 20
}
[ INFO 2014-07-22 11:46:04 API] GET /katello/api/organizations/14/environments/paths
[DEBUG 2014-07-22 11:46:04 API] Params: {}
[DEBUG 2014-07-22 11:46:04 API] Headers: {
    :params => {}
}
[DEBUG 2014-07-22 11:46:04 API] Response [
    [0] {
        "environments" => [
            [0] {
                "organization" => {
                    "label" => "mbZKYjhB",
                     "name" => "mbZKYjhB"
                },
                       "label" => "Library",
                  "created_at" => "2014-07-21T20:01:08Z",
                 "permissions" => {
                                     "destroy_lifecycle_environments" => true,
                                        "view_lifecycle_environments" => true,
                    "promote_or_remove_content_views_to_environments" => true,
                                        "edit_lifecycle_environments" => true
                },
                     "library" => true,
                        "name" => "Library",
                          "id" => 29,
                  "updated_at" => "2014-07-21T20:01:08Z",
                       "prior" => nil,
                 "description" => nil
            },
            [1] {
                "organization" => {
                    "label" => "mbZKYjhB",
                     "name" => "mbZKYjhB"
                },
                       "label" => "4d7e8179-a40a-4eed-9bb6-ebdcfc80bed1",
                  "created_at" => "2014-07-21T20:01:15Z",
                 "permissions" => {
                                     "destroy_lifecycle_environments" => true,
                                        "view_lifecycle_environments" => true,
                    "promote_or_remove_content_views_to_environments" => true,
                                        "edit_lifecycle_environments" => true
                },
                     "library" => false,
                        "name" => "\303\255\303\201\303\244\303\253\303\271\303\204\303\205\303\255\303\206\303\236\303\253\303\257\303\216\303\201\303\257\303\204\303\271\303\243",
                          "id" => 30,
                  "updated_at" => "2014-07-21T20:01:15Z",
                       "prior" => {
                      "id" => 29,
                    "name" => "Library"
                },
                 "description" => nil
            },
            [2] {
                "organization" => {
                    "label" => "mbZKYjhB",
                     "name" => "mbZKYjhB"
                },
                       "label" => "bb8bbdb3-610d-41df-b991-95395ccb71c4",
                  "created_at" => "2014-07-21T20:01:20Z",
                 "permissions" => {
                                     "destroy_lifecycle_environments" => true,
                                        "view_lifecycle_environments" => true,
                    "promote_or_remove_content_views_to_environments" => true,
                                        "edit_lifecycle_environments" => true
                },
                     "library" => false,
                        "name" => "\347\266\244\352\262\254\341\211\231\354\242\235\354\201\222\350\213\224\357\235\235\345\277\234\352\267\215\355\233\247\347\273\245\351\243\237\347\210\264\347\274\256\340\247\214\352\213\246\342\201\265\357\234\224\343\275\263\342\266\263\352\204\257\320\205\357\215\254\352\246\212\353\203\234\354\241\271\341\232\221\351\247\205\340\243\222\315\230",
                          "id" => 31,
                  "updated_at" => "2014-07-21T20:01:20Z",
                       "prior" => {
                      "id" => 30,
                    "name" => "\303\255\303\201\303\244\303\253\303\271\303\204\303\205\303\255\303\206\303\236\303\253\303\257\303\216\303\201\303\257\303\204\303\271\303\243"
                },
                 "description" => nil
            }
        ]
    }
]
[ERROR 2014-07-22 11:46:04 Exception] Error: can't convert String into Integer
Error: can't convert String into Integer
[ERROR 2014-07-22 11:46:04 Exception]

TypeError (can't convert String into Integer):
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/lib/hammer_cli_katello/lifecycle_environment.rb:41:in `[]'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/lib/hammer_cli_katello/lifecycle_environment.rb:41:in `extend_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:200:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:200:in `map!'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:200:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:244:in `retrieve_and_print'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:218:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:102
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Comment 2 Brad Buckingham 2014-10-23 22:16:57 UTC
I am not able to reproduce this error with the upstream; therefore, moving to POST for verification.

E.g.

$ bundle exec hammer lifecycle-environment paths --organization-id 1
------------------------------
LIFECYCLE PATH                
------------------------------
Library >> dev >> test >> prod
Library >> dev-1              
------------------------------

Comment 3 Tazim Kolhar 2014-12-05 13:51:09 UTC
VERIFIED:


*** This bug is verified in upstream. This fix should eventually land in future downstream builds ***
Version Tested:

# rpm -qa | grep foreman
foreman-compute-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_discovery-1.4.1-1.el7.noarch
foreman-selinux-1.8.0-0.develop.201411281557gitf4a857f.el7.noarch
foreman-libvirt-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2-1.el7.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410git163c264.git.0.988ca80.el7.noarch
foreman-ovirt-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7.noarch
foreman-postgresql-1.8.0-0.develop.201412040955git563fa28.el7.noarch
foreman-gce-1.8.0-0.develop.201412040955git563fa28.el7.noarch
foreman-vmware-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman-tasks-0.6.9-1.el7.noarch
foreman-proxy-1.8.0-0.develop.201411261259git6ddd00d.el7.noarch
ibm-x3550m3-07.lab.eng.brq.redhat.com-foreman-proxy-1.0-1.noarch
ruby193-rubygem-foreman_docker-0.2.0-2.el7.noarch
rubygem-hammer_cli_foreman-0.1.3-1.201411121216git9381fc5.el7.noarch
foreman-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ibm-x3550m3-07.lab.eng.brq.redhat.com-foreman-client-1.0-1.noarch
foreman-release-1.8.0-0.develop.201412040955git563fa28.el7.noarch

# hammer lifecycle-environment paths --organization-id 1
[Foreman] Username: admin
[Foreman] Password for admin: 
--------------
LIFECYCLE PATH
--------------
Library >> DEV
--------------

Comment 4 Bryan Kearney 2015-08-11 13:23:16 UTC
This bug is slated to be released with Satellite 6.1.

Comment 5 errata-xmlrpc 2015-08-12 05:11:17 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/RHSA-2015:1592


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