Project

General

Profile

Actions

Bug #18800

closed

content_facet_attributes no longer optional on api/hosts

Added by Klaas D over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Host groups
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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


Related issues 2 (0 open2 closed)

Related to Discovery - Bug #18791: Discovery v8.0.1 provisioning throws ActiveModel::ForbiddenAttributesError when Katello is installed.ClosedLukas Zapletal03/03/2017Actions
Related to Discovery - Bug #20797: Provisioning errors with undefined method permit! for ActiveSupport::HashWithIndifferentAccessResolved08/29/2017Actions
Actions

Also available in: Atom PDF