Bug 1316984

Summary: apipie-bindings for system ruby is out of date
Product: Red Hat Satellite Reporter: Jason Montleon <jmontleo>
Component: PackagingAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: ehelms
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-25 22: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 Jason Montleon 2016-03-11 16:02:07 UTC
Description of problem:
https://github.com/Apipie/apipie-bindings/commit/a6369fadb28472611d481c93ca42ae5df7fecbd4

This causes apipie-bindings to send optional parameters with required nested parameters to be sent. With the rails 4 deep munging converting empty arrays to nil this breaks api calls.

This may affect hammer as well.

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

How reproducible:
Always

Steps to Reproduce:
1. create an OS via the API in Satellite 6.2 using apipie-bindings

Actual results:
2016-03-11 09:36:08 [app] [I]   Parameters: {"operatingsystem"=>{"name"=>"CentOS", "major"=>"6", "minor"=>"6", "family"=>"Redhat", "os_parameters_attributes"=>nil}, "apiv"=>"v2"}
2016-03-11 09:36:08 [app] [I] Authorized user admin(Admin User)
2016-03-11 09:36:08 [app] [W] Action failed
 | ArgumentError: Hash or Array expected, got NilClass (nil)

Expected results:
success

Additional info:
Should be updated to 0.0.14 as in foreman upstream
http://yum.theforeman.org/releases/1.11/el7/x86_64/rubygem-apipie-bindings-0.0.14-2.el7.noarch.rpm

Comment 2 Jason Montleon 2016-03-13 03:15:43 UTC
I should say rather that the deep munging makes it impossible to work around it by sending an empty array or hash as it is converted to nil. 

Also, an updated apipie-bindings package has been built since this bug was opened and should fix the problem.

Comment 3 Eric Helms 2016-07-25 22:05:42 UTC
This should be available as of 6.2 -- if you find that it is not the case please re-open so that we may re-assess.