Updating extra capabilities fails on nodes reserved with no resource properties

Bug #1792245 reported by Pierre Riteau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
Critical
Pierre Riteau

Bug Description

When an operator updates an extra capability on a node that is reserved with resource_properties set to an empty string, they receive a 400 Client Error.

Pierre Riteau (priteau)
Changed in blazar:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Pierre Riteau (priteau)
milestone: none → stein-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to blazar (master)

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

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

Reviewed: https://review.openstack.org/602173
Committed: https://git.openstack.org/cgit/openstack/blazar/commit/?id=77c1a2b683716482cc8f64bfc3ca47708802e2f6
Submitter: Zuul
Branch: master

commit 77c1a2b683716482cc8f64bfc3ca47708802e2f6
Author: Pierre Riteau <email address hidden>
Date: Thu Sep 13 11:35:55 2018 -0600

    Handle requirements set to empty strings

    If hypervisor_properties or resource_properties are set to empty strings
    by the API client, they are persisted as empty strings in the database.
    However, in convert_requirements(), the code assumes they are JSON
    strings and tries to parse them, which raises a MalformedRequirements
    exception.

    This can be triggered by an operator when updating an extra capability
    on a node that is reserved with resource_properties set to an empty
    string, as is_updatable_extra_capability() calls convert_requirements().
    Blazar would return a 400 Client Error to them.

    Ideally, only valid JSON should be persisted to the database. However,
    this will require an Alembic migration to change existing empty strings
    to empty JSON arrays. In the meantime, this simpler patch can be
    backported to stable branches.

    Change-Id: Ic6d18418a2515cd37bbeed25ee3ab8c360624ca3
    Closes-Bug: #1792245

Changed in blazar:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 3.0.0.0rc1

This issue was fixed in the openstack/blazar 3.0.0.0rc1 release candidate.

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.