Actions
Bug #7989
closed/api/v2/hosts rejects POST request containing operatingsystem_id parameter
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1154156
Description of problem:
It is impossible to sucessfully POST the /hosts path.
When creating a host, an operating system ID is required via the operatingsystem_id parameter. However, the application responds with an HTTP 500 error:
operatingsystem_id is not allowed as nested parameter for hosts. Allowed parameters are hostgroup_id, location_id, organization_id, environment_id (RuntimeError)
Version-Release number of selected component (if applicable):
Tested against a nightly build of Satellite 6 with the following packages installed:
- apr-util-ldap-1.3.9-3.el6_0.1.x86_64
- candlepin-0.9.32-1.el6.noarch
- candlepin-common-1.0.8-1.el6.noarch
- candlepin-selinux-0.9.32-1.el6.noarch
- candlepin-tomcat6-0.9.32-1.el6.noarch
- elasticsearch-0.90.10-7.el6.noarch
- foreman-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- foreman-compute-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- foreman-gce-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- foreman-libvirt-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- foreman-ovirt-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- foreman-postgresql-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- foreman-proxy-1.7.0-0.develop.201410101404git7961640.el6.noarch
- foreman-release-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- foreman-selinux-1.7.0-0.develop.201409301113git2f345de.el6.noarch
- foreman-vmware-1.7.0-0.develop.201410150839gitb948163.el6.noarch
- katello-2.1.0-1.201410161306gite21feb2.el6.noarch
- katello-certs-tools-2.0.1-1.el6.noarch
- katello-default-ca-1.0-1.noarch
- katello-installer-2.1.0-1.201410151311git9100203.el6.noarch
- katello-repos-2.1.1-1.el6.noarch
- katello-server-ca-1.0-1.noarch
- openldap-2.4.23-32.el6_4.1.x86_64
- pulp-docker-plugins-0.2.1-0.2.beta.el6.noarch
- pulp-katello-0.3-3.el6.noarch
- pulp-nodes-common-2.5.0-0.7.beta.el6.noarch
- pulp-nodes-parent-2.5.0-0.7.beta.el6.noarch
- pulp-puppet-plugins-2.5.0-0.7.beta.el6.noarch
- pulp-puppet-tools-2.5.0-0.7.beta.el6.noarch
- pulp-rpm-plugins-2.5.0-0.7.beta.el6.noarch
- pulp-selinux-2.5.0-0.7.beta.el6.noarch
- pulp-server-2.5.0-0.7.beta.el6.noarch
- python-ldap-2.3.10-1.el6.x86_64
- ruby193-rubygem-ldap_fluff-0.3.2-1.el6.noarch
- ruby193-rubygem-net-ldap-0.3.1-2.el6.noarch
- ruby193-rubygem-runcible-1.2.0-1.el6.noarch
How reproducible:
100%
Steps to Reproduce:
See description and "Additional info:" section below.
Actual results:
No host is created.
Expected results:
A host is created.
Additional info:
Here's an example of parameters received by the API, taken from the application log file:
{"host"=>{
"operatingsystem_id"=>76,
"root_pass"=>"[FILTERED]",
"environment_id"=>103,
"ptable_id"=>55,
"medium_id"=>64,
"organization_id"=>383,
"mac"=>"1f:66:bb:75:5c:8e",
"architecture_id"=>53,
"location_id"=>384,
"domain_id"=>58,
"puppet_proxy_id"=>1,
"name"=>"mZmHqfwWSejeJ"
}, "apiv"=>"v2"}
Actions