Actions
Bug #38474
openSimultaneous POST to /api/hostgroup creates multiple Hostgroups with same name
Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Description
Description of problem:
Do two POST requests to create same Hostgroup name at same time creates a duplicated Hostgroup.
How reproducible:
Always
Is this issue a regression from an earlier version:
No
Steps to Reproduce:
Execute next curl at same time in two terminals
curl -X POST https://pafernan-6179sat.6179.pafernan.lan/api/hostgroups --user 'admin:redhat' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{ "hostgroup":{ "name": "test", "environment_id": 1, "architecture_id": 1, "domain_id": 1, "subnet_id": 1, "operatingsystem_id": 1, "medium_id": 6, "ptable_id": 7, "location_id": 1, "organization_id": 1 }}'
Actual behavior:
HostGroup "test" is created twice
Expected behavior:
One of the requests should fail as it already does if we retry:
{
"error": {"id":null,"errors":{"name":["has already been taken"]},"full_messages":["Name has already been taken"]}
}
No data to display
Actions