Actions
Bug #18800
closedcontent_facet_attributes no longer optional on api/hosts
Description
Hi,
I'm having an issue after the update to katello 3.3/foreman 1.14. I've been using a simple json to create testservers via api after upgrading and my json stopped working:
# cat testserver.json { "host" : { "name" : "el7testvmd001", "location_id" : "2", "organization_id" : "1", "compute_resource_id" : "1", "compute_profile_id" : "1", "hostgroup_id" : "1", "build" : true, "interfaces_attributes" : [ { "identifier" : "eth0", "name" : "el7testvmd001", "managed" : true, "primary" : true, "provision" : true, "subnet_id" : 9, "domain_id" : 1 }, { "identifier" : "eth1", "name" : "el7testvmd001a", "managed" : true, "primary" : false, "provision" : false, "subnet_id" : 1, "domain_id" : 1 }, { "identifier" : "eth2", "name" : "el7testvmd001s", "managed" : true, "primary" : false, "provision" : false, "subnet_id" : 6, "domain_id" : 1 }, { "identifier" : "eth3", "name" : "el7testvmd001n", "managed" : true, "primary" : false, "provision" : false, "subnet_id" : 5, "domain_id" : 1 } ] } } # curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X POST -u admin:password -k --data @testserver.json https://foremanserver.tld/api/hosts { "error": {"message":"ActiveModel::ForbiddenAttributesError"} }
if I add
"content_facet_attributes" : {},
it works as expected again
I'm not sure if this change was on purpose and its a documentation fix or if the code needs to be touched.
Greetings
Klaas
Updated by Klaas D almost 8 years ago
- Related to Bug #18791: Discovery v8.0.1 provisioning throws ActiveModel::ForbiddenAttributesError when Katello is installed. added
Updated by Lukas Zapletal almost 8 years ago
- Project changed from Katello to Foreman
- Category set to Host groups
I believe you are hitting same issue as in #18791. I think we need to call to_h in the method. I am changing project as this is core feature.
Updated by The Foreman Bot almost 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Lukas Zapletal
- Pull request https://github.com/theforeman/foreman/pull/4364 added
Updated by Timo Goebel almost 8 years ago
- Translation missing: en.field_release set to 227
I'd suggest putting this on 1.14.3. If anybody object, feel free to change the parameter.
Updated by Lukas Zapletal almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset ff74c383574a43952a9c9c371f407a20e5f7bc5a.
Updated by Lukas Zapletal over 7 years ago
- Related to Bug #20797: Provisioning errors with undefined method permit! for ActiveSupport::HashWithIndifferentAccess added
Actions