WebUI doesn't check a field type during regex validation

Bug #1447407 reported by Andrey Danin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Przemyslaw Kaminski
6.0.x
Won't Fix
High
Fuel Python (Deprecated)

Bug Description

Reproduced for ISO 6.0 GA release.
Maybe 6.1 branch is also affected.

If regexs are present for a cluster attribute and 'value' is not a string, the Cluster Settings tab doesn't show up when you click on it.
In a JS console a message appears:
"TypeError: e.value.match is not a function main.js:307:11695"
This is the code where the error occurs:
"e.regex&&e.regex.source&&!s(r)&&(e.value.match(new RegExp(e.regex.source))||(n[r]=e.regex.error))},this)},this),_.isEmpty(n)?null:n}"

How to reproduce:
1) download cluster settings via fuel-cli.
2) change ['storage']['osd_pool_size']['value'] from '2' (string) to 2 (int).
3) upload the settings.
4) try to look at them via WebUI.

The best place to fix it it's a backend. Nailgun shouldn't accept such invalid data.

Changed in fuel:
assignee: nobody → Fuel UI Team (fuel-ui)
milestone: none → 6.1
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/176653

Changed in fuel:
assignee: Fuel UI Team (fuel-ui) → Julia Aranovich (jkirnosova)
status: Confirmed → In Progress
Revision history for this message
Vitaly Kramskikh (vkramskikh) wrote :

This must be fixed by introducing of validation of JSON schema, so settings with number in the value won't be saved. UI can't just cover all the cases with invalid data. What if there would be null value? Boolean? Array of numbers?

Changed in fuel:
assignee: Julia Aranovich (jkirnosova) → Fuel Python Team (fuel-python)
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
status: In Progress → Confirmed
Revision history for this message
Vitaly Kramskikh (vkramskikh) wrote :

As a last resort solution, I can merge the proposed UI change to fix this particular issue. But this could trigger similar issues in other places - some puppet manifests could also expect a string there

Revision history for this message
Andrey Danin (gcon-monolake) wrote :

Agree. It's should be fixed on a backend side. Unfortunately, I cannot validate it right now against 6.1.

description: updated
tags: added: nailgun
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (master)

Change abandoned by Julia Aranovich (<email address hidden>) on branch: master
Review: https://review.openstack.org/176653
Reason: The issuw will be fixed on backend.

Dmitry Pyzhov (dpyzhov)
tags: added: feature-validation
removed: nailgun
Changed in fuel:
status: Confirmed → In Progress
assignee: Fuel Python Team (fuel-python) → Przemyslaw Kaminski (pkaminski)
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/178101

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

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

commit c83e79f06b41cef48f86f19066cee4f35d9b32df
Author: Przemyslaw Kaminski <email address hidden>
Date: Tue Apr 28 10:45:13 2015 +0200

    Validate cluster attributes

    Add validation for cluster attributes. Do it so that it doesn't break
    compatibility with current tests. Validate regexpes if they are provided.

    Change-Id: I9c1fc04dab45aecf3e32615172654d11844df7c3
    Closes-Bug: #1447407

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Vitaly Sedelnik (vsedelnik) wrote :

Won't Fix for 6.0-updates as this is feature request not a bug

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.