os-hosts extension accepts invalid host status

Bug #960884 reported by Unmesh Gurjar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unmesh Gurjar

Bug Description

Scenario: Update the status of a host to 'disablabc' using the os-hosts extension.

Request URL: http://127.0.0.1:8774/v2/03dce75fed734c019d87f30e738a0273/os-hosts/ubuntu-devstack
Request Body: {"status": "disablabc"}

Branch: master

Expected Response: 400 (Bad Request), Body: "Invalid status: 'disablabc'"
Actual Response: Currently returns a 500 (bug exists https://bugs.launchpad.net/nova/+bug/960226), but should have failed in the status value validation.

There is inconsistency in the manner 'status' and 'maintenance_mode' values are checked in the update method. The first 6 characters of the value provided in status is checked. The validation should be similar to 'maintenance_mode', where the entire status string is compared (the possible status values being 'enable' and disable').

Tags: ntt
Changed in nova:
assignee: nobody → Unmesh Gurjar (unmesh-gurjar)
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/5666

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

Reviewed: https://review.openstack.org/5666
Committed: http://github.com/openstack/nova/commit/b15bfc2edd5d3dd0dca805786bdcf22d3fb0339d
Submitter: Jenkins
Branch: master

commit b15bfc2edd5d3dd0dca805786bdcf22d3fb0339d
Author: Unmesh Gurjar <email address hidden>
Date: Thu Mar 22 11:19:45 2012 +0530

    Fixed status validation. Fixes bug 960884.

    Fixed the status value validation in os-hosts extension and added a negative
    scenario in unit test for os-hosts extension.

    Change-Id: Ib4166757561e531494a1a4d3070d7c8971b57dc5

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

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

Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-rc2
tags: removed: essex-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (milestone-proposed)

Reviewed: https://review.openstack.org/5777
Committed: http://github.com/openstack/nova/commit/5ab2facdd34934820db06fa5661c9104e63b9532
Submitter: Jenkins
Branch: milestone-proposed

commit 5ab2facdd34934820db06fa5661c9104e63b9532
Author: Unmesh Gurjar <email address hidden>
Date: Thu Mar 22 11:19:45 2012 +0530

    Fixed status validation. Fixes bug 960884.

    Fixed the status value validation in os-hosts extension and added a negative
    scenario in unit test for os-hosts extension.

    Change-Id: Ib4166757561e531494a1a4d3070d7c8971b57dc5

Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-rc2 → 2012.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.