Bug 1095937

Summary: Updating a lifecycle-environment name by passing an id raises an error
Product: Red Hat Satellite Reporter: Elyézer Rezende <erezende>
Component: HammerAssignee: Dustin Tsang <dtsang>
Status: CLOSED CURRENTRELEASE QA Contact: Kedar Bidarkar <kbidarka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bkearney, cwelton, jmontleo, kbidarka, mmccune
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/6101
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:05:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Elyézer Rezende 2014-05-08 21:35:22 UTC
Description of problem:
Updating a lifecycle-environment name by passing an id give "Missing options to search lifecycle_environment"

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



How reproducible:
Aways


Steps to Reproduce:
1. Create a lifecycle environment:

LANG=en_US hammer -v -u admin -p changeme  --output csv lifecycle-environment create --prior='Library' --name='izg2oiy9' --organization-id='uHUGybQWaekxlEeysIBl'

2. Try to update its name:

LANG=en_US hammer -v -u admin -p changeme  --output csv lifecycle-environment update --new-name='GFbtPyiDdFyFmDz' --id='311' --organization-id='uHUGybQWaekxlEeysIBl'

PS.: The organization have already been created

Actual results:
An error message saying that is missing option to search a lifecycle environment is raised but the id is passed as command argument.

Expected results:
The lifecycle environment name is updated without raising any error


Additional info:

$ LANG=en_US hammer -v -u admin -p changeme  --output csv lifecycle-environment update --new-name='GFbtPyiDdFyFmDz' --id='311' --organization-id='uHUGybQWaekxlEeysIBl'
[ERROR 2014-05-08 12:05:48 Exception] Error: Missing options to search lifecycle_environment
Could not update environment:
  Error: Missing options to search lifecycle_environment
[ERROR 2014-05-08 12:05:48 Exception] 

RuntimeError (Missing options to search lifecycle_environment):
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/id_resolver.rb:124:in `search_options'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/id_resolver.rb:101:in `find_resource'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/id_resolver.rb:95:in `get_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/id_resolver.rb:89:in `lifecycle_environment_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.3/lib/hammer_cli_katello/lifecycle_environment.rb:73:in `request_params'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/command.rb:42:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:108:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/command.rb:33: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.0/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.0/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.0/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.0/bin/hammer:100
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Comment 2 Dustin Tsang 2014-06-06 18:02:09 UTC
redmine issue created

Comment 6 Kedar Bidarkar 2014-06-12 09:56:05 UTC
[root@xxxx ~]# hammer lifecycle-environment update --new-name='Dev' --id=2  --organization=ACME_Corporation
Environment updated
[root@xxxx ~]# hammer lifecycle-environment list --organization=ACME_Corporation
---|---------|--------
ID | NAME    | PRIOR  
---|---------|--------
2  | Dev     | Library
1  | Library |        
---|---------|--------

verified with sat6-snap9


Installed Packages

    candlepin-0.9.7-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.7-1.el6_5.noarch
    candlepin-tomcat6-0.9.7-1.el6_5.noarch
    createrepo-0.9.9-21.2.pulp.el6sat.noarch
    dhcp207-55.lab.eng.pnq.redhat.com-qpid-broker-1.0-1.noarch
    dhcp207-55.lab.eng.pnq.redhat.com-qpid-client-cert-1.0-1.noarch
    elasticsearch-0.90.10-4.el6sat.noarch
    katello-1.5.0-25.el6sat.noarch
    katello-ca-1.0-1.noarch
    katello-certs-tools-1.5.5-1.el6sat.noarch
    katello-installer-0.0.48-1.el6sat.noarch
    m2crypto-0.21.1.pulp-10.el6sat.x86_64
    mod_wsgi-3.4-1.pulp.el6sat.x86_64
    pulp-katello-0.3-3.el6sat.noarch
    pulp-nodes-common-2.4.0-0.20.beta.el6sat.noarch
    pulp-nodes-parent-2.4.0-0.20.beta.el6sat.noarch
    pulp-puppet-plugins-2.4.0-0.20.beta.el6sat.noarch
    pulp-puppet-tools-2.4.0-0.20.beta.el6sat.noarch
    pulp-rpm-plugins-2.4.0-0.20.beta.el6sat.noarch
    pulp-selinux-2.4.0-0.20.beta.el6sat.noarch
    pulp-server-2.4.0-0.20.beta.el6sat.noarch
    python-gofer-qpid-1.2.1-1.el6sat.noarch
    python-isodate-0.5.0-1.pulp.el6sat.noarch
    python-kombu-3.0.15-10.pulp.el6sat.noarch
    python-pulp-bindings-2.4.0-0.20.beta.el6sat.noarch
    python-pulp-common-2.4.0-0.20.beta.el6sat.noarch
    python-pulp-puppet-common-2.4.0-0.20.beta.el6sat.noarch
    python-pulp-rpm-common-2.4.0-0.20.beta.el6sat.noarch
    python-qpid-0.22-14.el6sat.noarch
    python-qpid-qmf-0.22-31.el6sat.x86_64
    qpid-cpp-client-0.22-40.el6.x86_64
    qpid-cpp-server-0.22-40.el6.x86_64
    qpid-cpp-server-linearstore-0.22-40.el6.x86_64
    qpid-proton-c-0.7-1.el6.x86_64
    qpid-qmf-0.22-31.el6sat.x86_64
    qpid-tools-0.22-12.el6.noarch
    ruby193-rubygem-katello-1.5.0-57.el6sat.noarch
    rubygem-hammer_cli_katello-0.0.4-6.el6sat.noarch

Comment 7 Bryan Kearney 2014-07-02 14:05:42 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.