Hey, I'm facing different behavior in latest branch when sending same
request for provision:
the data duplicate itself with "discover =>" header
my request:
url: http://[myforeman-url]/discovers/52540007aa4d
header: Content-Type:application/json
data:
{
"host": {
"name": "52540007aa4d",
"hostgroup_id": "3",
"environment_id": "0",
"puppet_ca_proxy_id": "1",
"puppet_proxy_id": "1",
"puppetclass_ids": [
""
],
"managed": "true",
"progress_report_id": "",
"type": "Host::Managed",
"domain_id": "0",
"realm_id": "",
"mac": "52:54:00:07:b8:e0",
"subnet_id": "0",
"ip": "192.168.223.46",
"interfaces_attributes": {
"new_interfaces": {
"_destroy": "false",
"type": "Nic::Managed",
"mac": "",
"name": "",
"domain_id": "",
"ip": "",
"provider": "IPMI"
}
},
"architecture_id": "1",
"operatingsystem_id": "2",
"provision_method": "build",
"build": "1",
"medium_id": "3",
"ptable_id": "6",
"disk": "",
"root_pass": "123123123",
"enabled": "1",
"model_id": "",
"comment": "",
"overwrite": "false"
},
"id": "525400c61633"
}
in production log i get:
{"host"=>{"name"=>"52540007aa4d", "hostgroup_id"=>"3",
"environment_id"=>"0", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1",
"puppetclass_ids"=>[""], "managed"=>"true",
"progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed",
"domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0",
"subnet_id"=>"0", "ip"=>"192.168.223.46",
"interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"",
"provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"2",
"provision_method"=>"build", "build"=>"1", "medium_id"=>"3",
"ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "enabled"=>"1",
"model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "id"=>"52540007aa4d","discover"=>{"host"=>{"name"=>"52540007aa4d",
"hostgroup_id"=>"3", "environment_id"=>"0", "puppet_ca_proxy_id"=>"1",
"puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true",
"progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed",
"domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0",
"subnet_id"=>"0", "ip"=>"192.168.223.46",
"interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"",
"provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"2",
"provision_method"=>"build", "build"=>"1", "medium_id"=>"3",
"ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "enabled"=>"1",
"model_id"=>"", "comment"=>"", "overwrite"=>"false"}}}
after id=** the request repeats itself and the action fails.
my questions are:
- shouldn't the url change to api/v2/discovers/[id] ?
- why does it duplicate the data?
- was something changed in json requests? should I use x-www-form-urlencoded
instead?
thanks.
Yaniv Bronhaim.