From a12a662006ed3284f941384a1914eac3cbaf781a Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 24 Oct 2024 10:56:00 -0500 Subject: [PATCH] feat(schema): switch cpu_models to cpu_model --- .../ironic_understack/flavor_spec.py | 2 +- schema/flavor.schema.json | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/python/ironic-understack/ironic_understack/flavor_spec.py b/python/ironic-understack/ironic_understack/flavor_spec.py index 30fcd1262..359a16d47 100644 --- a/python/ironic-understack/ironic_understack/flavor_spec.py +++ b/python/ironic-understack/ironic_understack/flavor_spec.py @@ -34,7 +34,7 @@ def from_yaml(yaml_str: str) -> "FlavorSpec": model=data["model"], memory_gb=data["memory_gb"], cpu_cores=data["cpu_cores"], - cpu_model=data.get("cpu_model", data.get("cpu_models", [""]).pop()), + cpu_model=data["cpu_model"], drives=data["drives"], pci=data.get("pci", []), ) diff --git a/schema/flavor.schema.json b/schema/flavor.schema.json index 397b8c94e..5db821d51 100644 --- a/schema/flavor.schema.json +++ b/schema/flavor.schema.json @@ -25,16 +25,6 @@ "description": "Processor model", "type": "string" }, - "cpu_models": { - "description": "Processor models", - "type": "array", - "items": { - "type": "string", - "description": "Processor model" - }, - "minItems": 1, - "maxItems": 1 - }, "memory_gb": { "description": "Total memory in GB", "type": "number" @@ -80,5 +70,5 @@ } } }, - "required": [ "name", "manufacturer", "model", "cpu_cores", "cpu_models", "memory_gb", "drives" ] + "required": [ "name", "manufacturer", "model", "cpu_cores", "cpu_model", "memory_gb", "drives" ] }