Update aggregate allows duplicate names

Bug #1288296 reported by Julie Pichon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Juan Manuel Ollé
Havana
Fix Released
Undecided
Unassigned

Bug Description

The behaviour to manage naming conflicts is different between aggregate creation and aggregate update.

Aggregate create doesn't let you create 2 aggregates with the same name.
Aggregate update lets you update an aggregate to a name that already exists.

It seems to me it should be consistent, and probably both check for conflict.

Here's an example, using a recent devstack:

$ nova aggregate-create test
+----+------+-------------------+-------+----------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+-------+----------+
| 14 | test | - | | |
+----+------+-------------------+-------+----------+

$ nova aggregate-create test
ERROR: There was a conflict when trying to complete your request. (HTTP 409) (Request-ID: req-6711e05e-4efc-4a2d-9117-52d034c74a4f)

$ nova aggregate-create test2
+----+-------+-------------------+-------+----------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------+-------------------+-------+----------+
| 15 | test2 | - | | |
+----+-------+-------------------+-------+----------+

$ nova aggregate-update 15 test
Aggregate 15 has been successfully updated.
+----+------+-------------------+-------+----------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+-------+----------+
| 15 | test | - | | |
+----+------+-------------------+-------+----------+

$ nova aggregate-list
+----+--------------------+-------------------+
| Id | Name | Availability Zone |
+----+--------------------+-------------------+
| 14 | test | - |
| 15 | test | - |
+----+--------------------+-------------------+

Nova api logs from when the aggregate creation fails as expected:
2014-04-05 14:45:34.865 INFO nova.api.openstack.compute.contrib.aggregates [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] Aggregate test already exists.
2014-04-05 14:45:34.865 INFO nova.api.openstack.wsgi [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] HTTP exception thrown: There was a conflict when trying to complete your request.
2014-04-05 14:45:34.865 DEBUG nova.api.openstack.wsgi [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] Returning 409 to user: There was a conflict when trying to complete your request. from (pid=1517) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1223

Changed in nova:
assignee: nobody → Juan Manuel Ollé (juan-m-olle)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/78749

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/78749
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2b2decfd1b5b0d68813bc7e5b5e4349a1ab592aa
Submitter: Jenkins
Branch: master

commit 2b2decfd1b5b0d68813bc7e5b5e4349a1ab592aa
Author: Juan Manuel Olle <email address hidden>
Date: Thu Mar 6 17:38:07 2014 -0300

    Update aggregate should not allow duplicated names

    It is not allow to create 2 aggregates with the same name
    but if update an existing one with a name already used
    by other aggregate that check should be made.
    This patch doesn't allow to change the name to an existing
    one.

    Change-Id: Icfe315594beaec94229e5a4a4c1bb80fc366b66e
    Closes-Bug: #1288296

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/81963

Changed in nova:
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/havana)

Reviewed: https://review.openstack.org/81963
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a86ea38c62d122996a0d5fc443dd3c56c27fb778
Submitter: Jenkins
Branch: stable/havana

commit a86ea38c62d122996a0d5fc443dd3c56c27fb778
Author: Juan Manuel Olle <email address hidden>
Date: Thu Mar 6 17:38:07 2014 -0300

    Update aggregate should not allow duplicated names

    It is not allow to create 2 aggregates with the same name
    but if update an existing one with a name already used
    by other aggregate that check should be made.
    This patch doesn't allow to change the name to an existing
    one.

    Change-Id: Icfe315594beaec94229e5a4a4c1bb80fc366b66e
    Closes-Bug: #1288296
    (cherry picked from commit 2b2decfd1b5b0d68813bc7e5b5e4349a1ab592aa)

tags: added: in-stable-havana
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.