Reservation update fails if resource_type if not provided

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

Bug Description

Steps to reproduce:

blazar lease-create --physical-reservation min=1,max=1 a
blazar lease-update --reservation id=<reservation_id>,min=2,max=2 a

What is expected:

Update successful if enough resources are available.
Update fails with "not enough hosts" if not enough resources are available.

What actually happens:

Client gets the following error: "ERROR: resource_type cannot be updated"

Traceback in blazar-manager:

Traceback (most recent call last):
  File "/opt/stack/blazar/blazar/status.py", line 214, in wrapper
    result = func(*args, **kwargs)
  File "/opt/stack/blazar/blazar/manager/service.py", line 456, in update_lease
    raise exceptions.CantUpdateParameter(param='resource_type')
blazar.manager.exceptions.CantUpdateParameter: resource_type cannot be updated

This happens because the data in the `reservations` list only contains parameters provided by the client, in this case id, min, and max. The manager code checks if the resource_type key is present in each reservation dictionary, raising this exception.

Pierre Riteau (priteau)
Changed in blazar:
assignee: nobody → Pierre Riteau (priteau)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to blazar (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/blazar/+/824579

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

Reviewed: https://review.opendev.org/c/openstack/blazar/+/824579
Committed: https://opendev.org/openstack/blazar/commit/caf4b282f046d1f50d46eb657f575fda1a4fdae3
Submitter: "Zuul (22348)"
Branch: master

commit caf4b282f046d1f50d46eb657f575fda1a4fdae3
Author: Pierre Riteau <email address hidden>
Date: Thu Jan 13 15:23:52 2022 +0100

    Fix lease update when resource_type parameter is missing

    Change-Id: Id7771b63116064f2adc0cdfd700f14afa1ea6170
    Closes-Bug: #1957761

Changed in blazar:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to blazar (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/blazar/+/828744

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/blazar/+/828744
Committed: https://opendev.org/openstack/blazar/commit/f8140a21e3010f3673999cfbfeb1791950aebae0
Submitter: "Zuul (22348)"
Branch: stable/xena

commit f8140a21e3010f3673999cfbfeb1791950aebae0
Author: Pierre Riteau <email address hidden>
Date: Thu Jan 13 15:23:52 2022 +0100

    Fix lease update when resource_type parameter is missing

    Change-Id: Id7771b63116064f2adc0cdfd700f14afa1ea6170
    Closes-Bug: #1957761
    (cherry picked from commit caf4b282f046d1f50d46eb657f575fda1a4fdae3)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 9.0.0.0rc1

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to blazar (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/blazar/+/835056

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/blazar/+/835056
Committed: https://opendev.org/openstack/blazar/commit/dd844f09dcc75a33207b97538c4bcb069df9469c
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit dd844f09dcc75a33207b97538c4bcb069df9469c
Author: Pierre Riteau <email address hidden>
Date: Thu Jan 13 15:23:52 2022 +0100

    Fix lease update when resource_type parameter is missing

    Change-Id: Id7771b63116064f2adc0cdfd700f14afa1ea6170
    Closes-Bug: #1957761
    (cherry picked from commit caf4b282f046d1f50d46eb657f575fda1a4fdae3)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 7.0.1

This issue was fixed in the openstack/blazar 7.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 8.0.1

This issue was fixed in the openstack/blazar 8.0.1 release.

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.