Bug #6851
closedAPI error while creating a new OperatingSystem with incorrect data types
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1125003
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:
Updated by Dominic Cleal over 10 years ago
- Category set to API
- Assignee deleted (
Dominic Cleal)
Updated by Tom Caspy about 10 years ago
could not reproduce.
request:
curl -X POST -k -u admin:123456 http://localhost:3000/api/v2/operatingsystems -d '{"operatingsystem": {"major": 1, "release_name": "osrelease246", "name": "OperatingSystem_2799", "minor": 10, "family": "Redhat"}}' -H "Content-Type: application/json"
response:
{"description":null,"major":1,"minor":10,"family":"Redhat","release_name":"osrelease246","password_hash":"MD5","created_at":"2015-01-18T12:17:32Z","updated_at":"2015-01-18T12:17:32Z","id":2,"name":"OperatingSystem_2799","title":"OperatingSystem_2799 1.10","parameters":[],"media":[],"architectures":[],"ptables":[],"config_templates":[],"os_default_templates":[],"images":[]}
Updated by Dominic Cleal about 10 years ago
- Related to Feature #4386: implement gem friendly_id to simply find by id, name, label, etc added
Updated by Dominic Cleal about 10 years ago
- Status changed from New to Resolved
Appears to have been fixed here: https://github.com/theforeman/foreman/commit/8b737c9c7648b3726dadb3b2e4708fcb43af02a8#diff-ca0b1ebc260d7633163da1e5450eabb9L137