edit flavor deletes the flavor if special char is used

Bug #1148372 reported by Sam Stoelinga
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Lin Hua Cheng

Bug Description

Steps to reproduce:
1. Go to Syspanel > Flavors
2. Edit an existing flavor
3. Edit the name field to 'bug()'
4. Click Save

Current result:
The dialog opens again and says Error: There was an error submitting the form. Please try again.
After refreshing the page the flavor got deleted and isn't seen anymore

Expected result:
Save correctly even if there is a ( in the name or show a proper error to the user.

Wasn't sure yet if it's a bug in nova. why shouldn't a name be supported which contains ( ? We currently also support spaces.

Additional info:
The following characters are also known to cause this issue %* , probably a lot more but didn't test those.

This bug also applies to create flavor, as create flavor also just shows Error submitting form when invalid char is being used. This is because edit does a Delete flavor first and then a Create Flavor.

description: updated
description: updated
Changed in horizon:
status: New → Confirmed
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Investigated the issue, it seems like nova validating is blocking the special character in the flavor name.

Nova is returning 400 error with "names can only contain [a-zA-Z0-9_.- ]"

I can open a question to nova why we have this restriction

Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

This should be fixed similarly to https://github.com/openstack/horizon/commit/ff270d10596c0fbea2a44e520fe979bfc12642de

Basically, better validation on our before trying to make any API calls.

Changed in horizon:
importance: Undecided → Medium
milestone: none → havana-1
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Add the same regexp validation in horizon.

Changed in horizon:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
status: Confirmed → In Progress
Changed in horizon:
milestone: havana-1 → grizzly-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/25196
Committed: http://github.com/openstack/horizon/commit/a1012242d7e07c326a485d33371814be9892e1a1
Submitter: Jenkins
Branch: master

commit a1012242d7e07c326a485d33371814be9892e1a1
Author: Lin Hua Cheng <email address hidden>
Date: Fri Mar 22 16:57:45 2013 -0700

    Add flavor name regex validation to match nova.

    Fixes bug 1148372

    Change-Id: Ia1f4d974ddac6cd22c0b8979e98b2ea8f31deb21

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

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/25621

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (milestone-proposed)

Reviewed: https://review.openstack.org/25621
Committed: http://github.com/openstack/horizon/commit/a4ba8e14a68e88887a94ae73f42e36b7bfede7f8
Submitter: Jenkins
Branch: milestone-proposed

commit a4ba8e14a68e88887a94ae73f42e36b7bfede7f8
Author: Lin Hua Cheng <email address hidden>
Date: Fri Mar 22 16:57:45 2013 -0700

    Add flavor name regex validation to match nova.

    Fixes bug 1148372

    Change-Id: Ia1f4d974ddac6cd22c0b8979e98b2ea8f31deb21
    (cherry picked from commit a1012242d7e07c326a485d33371814be9892e1a1)

Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: grizzly-rc2 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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