Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1049832

Summary: CLI : hammer cli command ` os add_architecture` fails
Product: Red Hat Satellite Reporter: Tazim Kolhar <tkolhar>
Component: ProvisioningAssignee: Ohad Levy <ohadlevy>
Status: CLOSED DUPLICATE QA Contact: Tazim Kolhar <tkolhar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: cwelton, omaciel, skottler
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-08 10:41:58 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:
Attachments:
Description Flags
foreman-debug none

Description Tazim Kolhar 2014-01-08 10:26:53 UTC
Description of problem:
hammer cli command ` os add_architecture` fails

Version-Release number of selected component (if applicable):
# rpm -qa | grep foreman
rubygem-foreman_api-0.1.9-1.el6.noarch
foreman-compute-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
foreman-libvirt-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
foreman-postgresql-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
foreman-selinux-1.4.0-0.develop.201311220906gite342a0b.el6.noarch
rubygem-hammer_cli_foreman-0.0.15-1.el6.noarch
foreman-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
foreman-ovirt-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
foreman-installer-1.4.0-0.develop.201401031335gitf3eee21.el6.noarch
foreman-release-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
foreman-proxy-1.4.0-0.develop.201401031522gitd3509e6.el6.noarch


How reproducible:
everytime

Steps to Reproduce:
1.# hammer os add_architecture --id 1 --name testos --architecture x86_64 --architecture-id 3
Could not associate the architecture:
  Error: undefined method `[]' for nil:NilClass

2.
3.

Actual results:
The add_architecture command failed

Expected results:
The add architecture command works as expected

Additional info:

Comment 1 Tazim Kolhar 2014-01-08 10:30:25 UTC
Created attachment 847051 [details]
foreman-debug

Comment 2 RHEL Program Management 2014-01-08 10:36:24 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Tazim Kolhar 2014-01-08 10:40:35 UTC
# hammer --verbose os add_architecture --id 1 --name testos --architecture x86_64 --architecture-id 3
[ INFO 2014-01-08 05:39:34 Init] Initialization of Hammer CLI (0.0.14) has started...
[ INFO 2014-01-08 05:39:34 Init] Configuration from the file /etc/foreman/cli_config.yml has been loaded
[ INFO 2014-01-08 05:39:34 Modules] Extension module hammer_cli_foreman (0.0.15) loaded
[ INFO 2014-01-08 05:39:34 HammerCLI::MainCommand] Called with options: {"verbose"=>true}
[ INFO 2014-01-08 05:39:34 HammerCLIForeman::OperatingSystem] Called with options: {}
[ INFO 2014-01-08 05:39:34 HammerCLIForeman::AssociatingCommands::Architecture::AddArchitectureCommand] Called with options: {"id"=>"1", "associated_name"=>"x86_64", "associated_id"=>"3", "name"=>"testos"}
[ERROR 2014-01-08 05:39:34 Exception] Error: undefined method `[]' for nil:NilClass
Could not associate the architecture:
  Error: undefined method `[]' for nil:NilClass
[ERROR 2014-01-08 05:39:34 Exception] 

NoMethodError (undefined method `[]' for nil:NilClass):
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.15/lib/hammer_cli_foreman/commands.rb:256:in `get_current_ids'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.15/lib/hammer_cli_foreman/commands.rb:284:in `get_new_ids'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.15/lib/hammer_cli_foreman/commands.rb:266:in `request_params'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.15/lib/hammer_cli_foreman/commands.rb:34:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/./apipie/write_command.rb:10: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.0.14/lib/hammer_cli/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.0.14/lib/hammer_cli/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.0.14/lib/hammer_cli/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.0.14/bin/hammer:61
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Comment 5 Tazim Kolhar 2014-01-08 10:41:58 UTC

*** This bug has been marked as a duplicate of bug 1049829 ***