From 5495f1f16faa9241f84f2b2d8aebeb0da8e8f130 Mon Sep 17 00:00:00 2001 From: xusongfu Date: Thu, 18 Aug 2022 14:48:53 +0800 Subject: [PATCH] fix: fix ephemeral when create flavor Make ephemeral mandatory when category has ephemeral Change-Id: Iedb909872d28c97df288c8129d0477a4a972c82b --- .../containers/Flavor/actions/StepCreate/ParamSetting.jsx | 1 + .../compute/containers/Flavor/actions/StepCreate/index.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx b/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx index 59cd0746..e86011df 100644 --- a/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx +++ b/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx @@ -378,6 +378,7 @@ export class ParamSetting extends Base { type: 'input-int', min: 0, hidden: !hasEphemeral, + required: hasEphemeral, }, { name: 'ephemeralTmp', diff --git a/src/pages/compute/containers/Flavor/actions/StepCreate/index.jsx b/src/pages/compute/containers/Flavor/actions/StepCreate/index.jsx index 14ca9948..3c45a43f 100644 --- a/src/pages/compute/containers/Flavor/actions/StepCreate/index.jsx +++ b/src/pages/compute/containers/Flavor/actions/StepCreate/index.jsx @@ -132,7 +132,7 @@ export class StepCreate extends StepAction { }; const isPublic = accessType === 'public'; body['os-flavor-access:is_public'] = isPublic; - if (categoryHasEphemeral) { + if (categoryHasEphemeral(category)) { body['OS-FLV-EXT-DATA:ephemeral'] = ephemeral; } const properties = this.getProperties(architecture, category, settings);