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 about 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 #1

Updated by Klaas D over 7 years ago

  • Related to Bug #18791: Discovery v8.0.1 provisioning throws ActiveModel::ForbiddenAttributesError when Katello is installed. added
Actions #2

Updated by Lukas Zapletal over 7 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.

Actions #3

Updated by The Foreman Bot over 7 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
Actions #4

Updated by Timo Goebel over 7 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.

Actions #5

Updated by Lukas Zapletal over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #6

Updated by Lukas Zapletal almost 7 years ago

  • Related to Bug #20797: Provisioning errors with undefined method permit! for ActiveSupport::HashWithIndifferentAccess added
Actions

Also available in: Atom PDF