Bug 1026803

Summary: Hammer CLI - set_parameter command fails with undefined method `[]' for nil:NilClass"
Product: Red Hat Satellite Reporter: Hayk Hovsepyan <hhovsepy>
Component: ProvisioningAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED CURRENTRELEASE QA Contact: Sachin Ghai <sghai>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.2CC: dcleal, ohadlevy, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/3583
Whiteboard:
Fixed In Version: rubygem-hammer_cli_foreman-0.0.12-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:09:27 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 Hayk Hovsepyan 2013-11-05 13:23:29 UTC
Description of problem:
Here are some more "os" commands that fail to execute:

"hammer --output base os set_parameter --os-id "123" --name "testparam" --value "testvalue""  has output "Could not set operating system parameter:
  Error: undefined method `[]' for nil:NilClass"


"hammer --output base os list --search $search" does not return any result.

rubygem-foreman_api-0.1.8-2.el6sat.noarch
katello-foreman-all-1.4.6-55.el6sat.noarch
ruby193-rubygem-foreman_api-0.1.8-2.el6sat.noarch
dionysus.usersys.redhat.com-foreman-client-1.0-1.noarch
foreman-postgresql-1.3.0-25.el6sat.noarch
ruby193-rubygem-katello-foreman-engine-0.0.12-4.el6sat.noarch
foreman-proxy-1.3.0-3.el6sat.noarch
dionysus.usersys.redhat.com-foreman-proxy-1.0-1.noarch
rubygem-hammer_cli_foreman-0.0.9-2.el6sat.noarch
foreman-1.3.0-25.el6sat.noarch
ruby193-rubygem-foreman-katello-engine-0.0.17-7.el6sat.noarch
katello-configure-foreman-1.4.7-7.el6sat.noarch
Katello-Katello-Installation-HammerCLI-1.0-9.noarch
rubygem-hammer_cli-0.0.8-2.el6sat.noarch

Comment 1 RHEL Program Management 2013-11-05 13:27:18 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 3 Hayk Hovsepyan 2013-11-05 15:35:22 UTC
"hammer os add_configtemplate/remove_configtemplate/add_architecture/remove_architecture" commands fail with error: "Error: resource or action not defined".

Comment 4 Dominic Cleal 2013-11-05 15:55:50 UTC
(In reply to Hayk Hovsepyan from comment #3)
> "hammer os
> add_configtemplate/remove_configtemplate/add_architecture/
> remove_architecture" commands fail with error: "Error: resource or action
> not defined".

I think this is bug #1025544.

I can't replicate any issues with the list --search command (`hammer os list --search "name = Fedora"` works), so if you can elaborate on that and file it separate if necessary that'd be appreciated.

Comment 5 Hayk Hovsepyan 2013-11-06 10:11:36 UTC
Os search works fine.

Comment 9 Sachin Ghai 2014-05-06 09:06:20 UTC
Verified with Satellite-6.0.3-RHEL-6-20140430.4

os set-parameter works
=======================
[root@qetello02 yum.repos.d]# hammer os create --name 'testos' --major '2'
Operating system created

[root@qetello02 yum.repos.d]# hammer os set-parameter --name 'testparam' --value 'works' --os-id 68
New operating system parameter created

[root@qetello02 yum.repos.d]# hammer os info --id 68
Id:                   68
Name:                 testos 2
Release name:         
Family:               
Installation media:   
Architectures:        
Partition tables:     
Config templates:     
Default OS templates: 
Parameters:           
 1) testparam => works


OS search works too:
===================

[root@qetello02 yum.repos.d]# hammer os list --search "name = testos"
---|-----------------------|--------------|-------
ID | NAME                  | RELEASE NAME | FAMILY
---|-----------------------|--------------|-------
68 | testos 2              |              |       
---|-----------------------|--------------|-------
[root@qetello02 yum.repos.d]#

Comment 10 Bryan Kearney 2014-07-02 14:09:25 UTC
This was delivered in 6.0.3, the Beta version of Satellite 6.0

Comment 11 Bryan Kearney 2014-07-02 14:09:27 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.