Inventory update will re-default max_unit
Bug #2112208 reported by
Dan Smith
This bug affects 1 person
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| placement |
New
|
Undecided
|
Unassigned | ||
Bug Description
If you have an existing inventory and you just update something like total or reserved, and do not provide max_unit, placement will re-default max_unit to MAX_INT instead of keeping the value that is currently set. I'm sure this was not intentional and means that if we update another field, the max_unit will become very large and surely not what the user intends.
To post a comment you must log in.
semanticly invetory update is a http PUT https:/ /docs.openstack .org/api- ref/placement/ #update- resource- provider- inventory
so it shoudl only accpet full not partial objects so i think the correct behavior would be do do the following.
in a new micro version make partial updates a 400 and support patch for partial updates if that is desired.
patch should only mutate the filed that are present in the request and not modify the other values
i agree that its valid for post to support optional filed and have default this i hydrate server side but its not valid IMO for put to do that.
this api currently use PUT for both create and update and i think the optionallty ws intended for the create path which normlaly would use POST
the same issue seam to be present on
https:/ /docs.openstack .org/api- ref/placement/ #update- resource- provider- inventories
im not sure who this is handed in
https:/ /docs.openstack .org/api- ref/placement/ #update- resource- provider provider_ uuid
with regards to parent_