summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-09-30 18:30:17 +0000
committerGerrit Code Review <review@openstack.org>2020-09-30 18:30:17 +0000
commitceb45d767045126e07dd0c9a42877b81d9b05ff6 (patch)
tree7fa5bbf9aa0dcead5335256572a23347cb7d6b6d
parent35281912c3ae7969357935b797df3106ec61f807 (diff)
parenta1c5559fae6b7b0cddfe7c34e9a831d34464a189 (diff)
downloadironic-ceb45d767045126e07dd0c9a42877b81d9b05ff6.tar.gz
Merge "Handle patching node /protected value with None"
-rw-r--r--ironic/api/controllers/v1/node.py3
-rw-r--r--releasenotes/notes/protected-unset-0620b844afbb635e.yaml5
2 files changed, 8 insertions, 0 deletions
diff --git a/ironic/api/controllers/v1/node.py b/ironic/api/controllers/v1/node.py
index cba7a4e5c..46c02521d 100644
--- a/ironic/api/controllers/v1/node.py
+++ b/ironic/api/controllers/v1/node.py
@@ -1988,6 +1988,9 @@ class NodesController(rest.RestController):
# of just before saving so we calculate correctly.
if field == 'conductor_group':
patch_val = patch_val.lower()
+ # Node object protected field is not nullable
+ if field == 'protected' and patch_val is None:
+ patch_val = False
if rpc_node[field] != patch_val:
rpc_node[field] = patch_val
diff --git a/releasenotes/notes/protected-unset-0620b844afbb635e.yaml b/releasenotes/notes/protected-unset-0620b844afbb635e.yaml
new file mode 100644
index 000000000..f516a5c0e
--- /dev/null
+++ b/releasenotes/notes/protected-unset-0620b844afbb635e.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - |
+ Fixes HTTP 500 when trying to unset the ``protected`` attribute via
+ the CLI.