summaryrefslogtreecommitdiff
path: root/ironic/api/controllers/v1/utils.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-03-17 00:47:04 +0000
committerGerrit Code Review <review@openstack.org>2021-03-17 00:47:04 +0000
commite058a5a3a144568f007448fee84ac137caa80a73 (patch)
treeb7e4b811facc468161f0f383515e2bfe11fabbcc /ironic/api/controllers/v1/utils.py
parent5584cc4cbbc5dd7eb25280532bc8cad8c497bd0f (diff)
parent30a85bd0cecc395a83790e637368ce4476cdf7f9 (diff)
downloadironic-e058a5a3a144568f007448fee84ac137caa80a73.tar.gz
Merge "API to force manual cleaning without booting IPA"
Diffstat (limited to 'ironic/api/controllers/v1/utils.py')
-rw-r--r--ironic/api/controllers/v1/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ironic/api/controllers/v1/utils.py b/ironic/api/controllers/v1/utils.py
index 1fea853d0..7d25670c2 100644
--- a/ironic/api/controllers/v1/utils.py
+++ b/ironic/api/controllers/v1/utils.py
@@ -1986,3 +1986,14 @@ def check_allow_deploy_steps(target, deploy_steps):
'provision state to %s or %s') % allowed_states)
raise exception.ClientSideError(
msg, status_code=http_client.BAD_REQUEST)
+
+
+def check_allow_clean_disable_ramdisk(target, disable_ramdisk):
+ if disable_ramdisk is None:
+ return
+ elif api.request.version.minor < versions.MINOR_70_CLEAN_DISABLE_RAMDISK:
+ raise exception.NotAcceptable(
+ _("disable_ramdisk is not acceptable in this API version"))
+ elif target != "clean":
+ raise exception.BadRequest(
+ _("disable_ramdisk is supported only with manual cleaning"))