Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-34685

Hostgroup names are not enforced to be unique at the database level

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.17.z
    • Host Group
    • None
    • None
    • None
    • To Do

      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"]}
      }
      ~~~

       

              Unassigned Unassigned
              rhn-support-pafernan Pablo Fernandez Rodriguez
              Pablo Fernandez Rodriguez
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: