summaryrefslogtreecommitdiff
path: root/ironic/api/controllers/v1/utils.py
diff options
context:
space:
mode:
authorKaifeng Wang <kaifeng.w@gmail.com>2018-06-05 20:33:00 +0800
committerRuby Loo <opensrloo@gmail.com>2018-06-06 13:20:55 +0000
commit8ee2f4b58f62d2c96e7da640e17102e979322eb1 (patch)
tree1f842d4927156cebda00c0d06029b7b6263709f9 /ironic/api/controllers/v1/utils.py
parentd69dc019cb0573a3edcbff3ccca479cefc5ec67c (diff)
downloadironic-8ee2f4b58f62d2c96e7da640e17102e979322eb1.tar.gz
Power fault recovery follow up
This patch addresses comments relate to API and notification. [1] https://review.openstack.org/#/c/558152 [2] https://review.openstack.org/#/c/556015/ Story: #1596107 Task: #10469 Change-Id: Ic2f7e6847790ae7af43570ca7af572539e7d5f2c
Diffstat (limited to 'ironic/api/controllers/v1/utils.py')
-rw-r--r--ironic/api/controllers/v1/utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ironic/api/controllers/v1/utils.py b/ironic/api/controllers/v1/utils.py
index 7ea7cf578..e97cadb75 100644
--- a/ironic/api/controllers/v1/utils.py
+++ b/ironic/api/controllers/v1/utils.py
@@ -479,6 +479,19 @@ def check_allow_configdrive(target):
msg, status_code=http_client.BAD_REQUEST)
+def check_allow_filter_by_fault(fault):
+ """Check if filtering nodes by fault is allowed.
+
+ Version 1.42 of the API allows filtering nodes by fault.
+ """
+ if (fault is not None and pecan.request.version.minor
+ < versions.MINOR_42_FAULT):
+ raise exception.NotAcceptable(_(
+ "Request not acceptable. The minimal required API version "
+ "should be %(base)s.%(opr)s") % {'base': versions.BASE_VERSION,
+ 'opr': versions.MINOR_42_FAULT})
+
+
def initial_node_provision_state():
"""Return node state to use by default when creating new nodes.