Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1125003 - API error while creating a new OperatingSystem with incorrect data types
API error while creating a new OperatingSystem with incorrect data types
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API (Show other bugs)
6.0.3
Unspecified Unspecified
low Severity low (vote)
: Unspecified
: Unused
Assigned To: Dominic Cleal
jaudet
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-30 15:50 EDT by Og Maciel
Modified: 2017-02-23 16:09 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:12:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 6851 None None None 2016-04-22 12:57 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Og Maciel 2014-07-30 15:50:57 EDT
Description of problem:

Our automation has shown that creating an operating system via the API is failing when providing the 'minor' version field with the following error:

  undefined method `empty?' for 10:Fixnum

curl -X POST -k  -u admin:changeme https://SERVER/api/v2/operatingsystems -d {"operatingsystem": {"major": 1, "release_name": "osrelease246", "name": "OperatingSystem_2799", "minor": 10, "family": "Redhat"}} 

 500 
 {
  "error": {"message":"undefined method `empty?' for 10:Fixnum"}
}


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

Build: atellite-6.0.4-RHEL-6-20140730.0

Packages:

* 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.34-1.el6sat.noarch
* foreman-compute-1.6.0.34-1.el6sat.noarch
* foreman-gce-1.6.0.34-1.el6sat.noarch
* foreman-libvirt-1.6.0.34-1.el6sat.noarch
* foreman-ovirt-1.6.0.34-1.el6sat.noarch
* foreman-postgresql-1.6.0.34-1.el6sat.noarch
* foreman-proxy-1.6.0.23-1.el6sat.noarch
* foreman-selinux-1.6.0.4-1.el6sat.noarch
* foreman-vmware-1.6.0.34-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-31.el6.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-11.el6sat.noarch
* rubygem-hammer_cli_foreman-0.1.1-15.el6sat.noarch
* rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch
* rubygem-hammer_cli_katello-0.0.4-10.el6sat.noarch

How reproducible:


Steps to Reproduce:
1. Use the API to create a new operating system, providing the 'minor' version
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 Og Maciel 2014-07-30 15:51:22 EDT
Somehow this doesn't seem to affect the UI.
Comment 3 Dominic Cleal 2014-07-31 03:01:26 EDT
Both minor and major are strings, not integers, as per the API doc:
http://theforeman.org/api/apidoc/v2/operatingsystems/create.html
Comment 4 Dominic Cleal 2014-07-31 03:01:45 EDT
Created redmine issue http://projects.theforeman.org/issues/6851 from this bug
Comment 5 Bryan Kearney 2015-01-19 06:03:08 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/6851 has been closed
-------------
Dominic Cleal
Appears to have been fixed here: https://github.com/theforeman/foreman/commit/8b737c9c7648b3726dadb3b2e4708fcb43af02a8#diff-ca0b1ebc260d7633163da1e5450eabb9L137
Comment 8 jaudet 2015-03-09 10:11:25 EDT
Tested against Satellite-6.1.0-RHEL-6-20150303.0 and Satellite-6.1.0-RHEL-7-20150303.0. Automated tests for this bug should be added to QE's test suite shortly. See: https://github.com/SatelliteQE/robottelo/pull/1974
Comment 9 Bryan Kearney 2015-08-11 09:31:39 EDT
This bug is slated to be released with Satellite 6.1.
Comment 10 errata-xmlrpc 2015-08-12 01:12:08 EDT
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.