Red Hat Bugzilla – Bug 1125003
API error while creating a new OperatingSystem with incorrect data types
Last modified: 2017-02-23 16:09:18 EST
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:
Somehow this doesn't seem to affect the UI.
Both minor and major are strings, not integers, as per the API doc: http://theforeman.org/api/apidoc/v2/operatingsystems/create.html
Created redmine issue http://projects.theforeman.org/issues/6851 from this bug
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
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
This bug is slated to be released with Satellite 6.1.
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