[virt role]JSON validation doesn't work

Bug #1582136 reported by Nastya Urlapova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Alexander Saprykin
Mitaka
Fix Released
High
Alexander Saprykin
Newton
Fix Committed
High
Alexander Saprykin

Bug Description

ISO 9.0-mos-354

Detailed bug description:

As user I can put incorrect values to JSON config.

Steps to reproduce:
0) Prepare env with 3 node
1) Add FEATURE_GROUPS: ["advanced"] to /etc/nailgun/settings.yaml
2) service nailgun restart
3) Add virt, comute role to the node
4) Try to add json config to the virt role
>>>{"id":1,"mem":0,"cpu":-2}'

I can put incorrect values, and I don't get any message about that.

Changed in fuel:
importance: Undecided → High
Revision history for this message
Ksenia Svechnikova (kdemina) wrote :

Also we can upload configs with

fuel2 node create-vms-conf 2 --conf '[{"id":1,"mem":4,"cpu":2},{"id":2,"mem":4,"cpu":2},{"id":3,"mem":4,"cpu":2}]'

This will lead to errors on provisioning state

tags: added: area-python feature-reduced-footprint
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/316872

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-fuelclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/318000

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

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

commit cc3dbfabb33317141fae0165f3537eda64b18a44
Author: Alexander Saprykin <email address hidden>
Date: Mon May 16 16:14:28 2016 +0200

    Validate node VMs format

    Add validation for creating node VMs config in NodeVMsHandler.

    Change-Id: I0716f03e0f40b45d834ec846795dee78e68e4cd5
    Closes-Bug: #1582136

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

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/319111

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

Reviewed: https://review.openstack.org/319111
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=9b2e2f84c7c06da00807aabfe1167bccca19a858
Submitter: Jenkins
Branch: stable/mitaka

commit 9b2e2f84c7c06da00807aabfe1167bccca19a858
Author: Alexander Saprykin <email address hidden>
Date: Mon May 16 16:14:28 2016 +0200

    Validate node VMs format

    Add validation for creating node VMs config in NodeVMsHandler.

    Change-Id: I0716f03e0f40b45d834ec846795dee78e68e4cd5
    Closes-Bug: #1582136
    (cherry picked from commit cc3dbfabb33317141fae0165f3537eda64b18a44)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-fuelclient (master)

Reviewed: https://review.openstack.org/318000
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=298187d131a3aa3162b75530b8f661edf4550101
Submitter: Jenkins
Branch: master

commit 298187d131a3aa3162b75530b8f661edf4550101
Author: Alexander Saprykin <email address hidden>
Date: Wed May 18 13:27:25 2016 +0200

    Allow passing list of dicts for create-vms-conf command.

    Previous implementation of command "fuel2 node create-vms-conf"
    didn't allow using list of dicts for --conf parameter. It required
    to use multiple arguments like:
        --conf '{"id": 1}' '{"id": 2}'
    which is non obvious for user and inconsistent with UI (in UI
    user sees list of dicts).
    This patch introduces new possibility to pass parameters
    as json list:
        --conf '[{"id": 1}, {"id": 2}]'

    Change-Id: I50e961c1afce91fd1c43d1fdcf6436a08a20c2be
    Related-Bug: #1582136
    Closes-Bug: #1582120

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-fuelclient (stable/mitaka)

Related fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/320462

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-fuelclient (stable/mitaka)

Reviewed: https://review.openstack.org/320462
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=39f6f5f0453ba5c3f23aea26300af0fb71b40dc1
Submitter: Jenkins
Branch: stable/mitaka

commit 39f6f5f0453ba5c3f23aea26300af0fb71b40dc1
Author: Alexander Saprykin <email address hidden>
Date: Wed May 18 13:27:25 2016 +0200

    Allow passing list of dicts for create-vms-conf command.

    Previous implementation of command "fuel2 node create-vms-conf"
    didn't allow using list of dicts for --conf parameter. It required
    to use multiple arguments like:
        --conf '{"id": 1}' '{"id": 2}'
    which is non obvious for user and inconsistent with UI (in UI
    user sees list of dicts).
    This patch introduces new possibility to pass parameters
    as json list:
        --conf '[{"id": 1}, {"id": 2}]'

    Change-Id: I50e961c1afce91fd1c43d1fdcf6436a08a20c2be
    Related-Bug: #1582136
    Closes-Bug: #1582120
    (cherry-picked from commit 298187d131a3aa3162b75530b8f661edf4550101)

tags: added: in-stable-mitaka
Revision history for this message
Ksenia Svechnikova (kdemina) wrote :

Verify on ISO 9.0 mos 404,

Get error for negative values: deque(['vms_conf', 0, 'cpu']): -1.0 is less than the minimum of 1

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-fuelclient (stable/8.0)

Related fix proposed to branch: stable/8.0
Review: https://review.openstack.org/351604

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-fuelclient (stable/7.0)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-fuelclient (stable/8.0)

Reviewed: https://review.openstack.org/351604
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=d0f6840a48f6c3aafa6aafae38439ead364ff831
Submitter: Jenkins
Branch: stable/8.0

commit d0f6840a48f6c3aafa6aafae38439ead364ff831
Author: Alexander Saprykin <email address hidden>
Date: Wed May 18 13:27:25 2016 +0200

    Allow passing list of dicts for create-vms-conf command.

    Previous implementation of command "fuel2 node create-vms-conf"
    didn't allow using list of dicts for --conf parameter. It required
    to use multiple arguments like:
        --conf '{"id": 1}' '{"id": 2}'
    which is non obvious for user and inconsistent with UI (in UI
    user sees list of dicts).
    This patch introduces new possibility to pass parameters
    as json list:
        --conf '[{"id": 1}, {"id": 2}]'

    Conflicts:
     fuelclient/commands/node.py
     fuelclient/tests/unit/common/test_utils.py

    Change-Id: I50e961c1afce91fd1c43d1fdcf6436a08a20c2be
    Related-Bug: #1582136
    Closes-Bug: #1582120
    (cherry-picked from commit 39f6f5f0453ba5c3f23aea26300af0fb71b40dc1)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-fuelclient (stable/7.0)

Reviewed: https://review.openstack.org/351615
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=9bed2eaa4517edb2a15a6778a1c484bcad1b0c75
Submitter: Jenkins
Branch: stable/7.0

commit 9bed2eaa4517edb2a15a6778a1c484bcad1b0c75
Author: Alexander Saprykin <email address hidden>
Date: Wed May 18 13:27:25 2016 +0200

    Allow passing list of dicts for create-vms-conf command

    Previous implementation of command "fuel2 node create-vms-conf"
    didn't allow using list of dicts for --conf parameter. It required
    to use multiple arguments like:
        --conf '{"id": 1}' '{"id": 2}'
    which is non obvious for user and inconsistent with UI (in UI
    user sees list of dicts).
    This patch introduces new possibility to pass parameters
    as json list:
        --conf '[{"id": 1}, {"id": 2}]'

    Change-Id: I50e961c1afce91fd1c43d1fdcf6436a08a20c2be
    Related-Bug: #1582136
    Closes-Bug: #1582120
    (cherry-picked from commit d0f6840a48f6c3aafa6aafae38439ead364ff831)

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.