From 64ac67fd19bd43024de9e2c84be5bc27ec9fae55 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 1 Jul 2024 11:18:06 +0100 Subject: [PATCH] api: Correct bug in flavors schema The 'rxtx_factor' is a float, not an integer, and should allow values < 1 so long as they are > 0. Correct this. Change-Id: I3567f13d7a1bb6f42755e3f5739fa9ecd827aa49 Signed-off-by: Stephen Finucane --- nova/api/openstack/compute/schemas/flavors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/api/openstack/compute/schemas/flavors.py b/nova/api/openstack/compute/schemas/flavors.py index 6f4d609e65..188e15c8c6 100644 --- a/nova/api/openstack/compute/schemas/flavors.py +++ b/nova/api/openstack/compute/schemas/flavors.py @@ -50,7 +50,10 @@ create = { 'rxtx_factor': { 'type': ['number', 'string'], 'pattern': r'^[0-9]+(\.[0-9]+)?$', - 'minimum': 1, + # this is a float, so we want to allow everything close to + # 0 (e.g. 0.1) but not 0 itself, hence exclusiveMinimum + # rather than the usual minimum + 'exclusiveMinimum': 0, # maximum's value is limited to db constant's # SQL_SP_FLOAT_MAX (in nova/db/constants.py) 'maximum': 3.40282e+38