PUT to NetworkGroupHandler throws 409 when network name is not changed

Bug #1494974 reported by Aleksey Kasatkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Ryan Moe
7.0.x
Fix Released
Medium
Artem Roma
8.0.x
Fix Released
Medium
Ryan Moe

Bug Description

Version: 7.0 RC

Validator for NetworkGroupHandler:PUT throws 409 when network name is set in the request and it is the same name as that network has before the request. So, when user simply sends data received as the GET's output to PUT method, it fails with 409 (because the network with provided name is in DB already).

The problem is that validate_update() calls validate() which is used for POST:
https://github.com/stackforge/fuel-web/blob/e2ea8c0d8f2c413b3c281f47eb97f4c3cb3e1011/nailgun/nailgun/api/v1/validators/network.py#L543
and the check: https://github.com/stackforge/fuel-web/blob/e2ea8c0d8f2c413b3c281f47eb97f4c3cb3e1011/nailgun/nailgun/api/v1/validators/network.py#L532 is valid for POST only. For PUT it is valid only if the network name in request is different from one that network has before the request. So, it should be checked in validator for PUT method whether it is requested to rename the network or not.

Revision history for this message
Aleksey Kasatkin (alekseyk-ru) wrote :

As workaround, user can remove network name from request before passing it to PUT.

Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
status: New → Confirmed
importance: High → Medium
Ryan Moe (rmoe)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Ryan Moe (rmoe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

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

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

Reviewed: https://review.openstack.org/227040
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=489d39859910dafff12190a6ec515f8718dd3ceb
Submitter: Jenkins
Branch: master

commit 489d39859910dafff12190a6ec515f8718dd3ceb
Author: Ryan Moe <email address hidden>
Date: Wed Sep 23 15:28:50 2015 -0700

    Improve network group validation

    The validation for creating network groups and updating
    them has been split into two independent methods. This
    This change also prevents a network group's nodegroup from
    being changed.

    Change-Id: I0fb6e9c5f77effa8f1c81014f6151dafd98357d8
    Closes-bug: #1494842
    Closes-bug: #1494974

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-web (stable/7.0)

Related fix proposed to branch: stable/7.0
Review: https://review.openstack.org/232025

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/7.0)

Fix proposed to branch: stable/7.0
Review: https://review.openstack.org/232428

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/7.0)

Change abandoned by Artem Roma (<email address hidden>) on branch: stable/7.0
Review: https://review.openstack.org/232025
Reason: The patch was not properly backported

Revision history for this message
Vitaly Sedelnik (vsedelnik) wrote :

Targeted to 7.0-mu-1 because this fix is required by https://bugs.launchpad.net/fuel/+bug/1500308

Dmitry Pyzhov (dpyzhov)
tags: added: 70mu1-confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/7.0)

Reviewed: https://review.openstack.org/232428
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=f7dac02379d706926757fca6c0fb42a2e2c7dcb2
Submitter: Jenkins
Branch: stable/7.0

commit f7dac02379d706926757fca6c0fb42a2e2c7dcb2
Author: Ryan Moe <email address hidden>
Date: Wed Sep 23 15:28:50 2015 -0700

    Improve network group validation

    The validation for creating network groups and updating
    them has been split into two independent methods.
    This change also prevents a network group's nodegroup from
    being changed.

    Change-Id: I0fb6e9c5f77effa8f1c81014f6151dafd98357d8
    Closes-bug: #1494842
    Closes-bug: #1494974

Dmitry Pyzhov (dpyzhov)
tags: added: area-python
tags: removed: 70mu1-confirmed
tags: added: on-verification
Revision history for this message
Andrey Sledzinskiy (asledzinskiy) wrote :

verified on 7.0-301 with MU

tags: added: 7mu1-verified
removed: on-verification
Revision history for this message
Nastya Urlapova (aurlapova) wrote :

Moved to Fix released due to the comment above.

tags: removed: 7mu1-verified
Revision history for this message
Sergey Novikov (snovikov) wrote :

Verified on MOS 8.0 RC#1

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.