Merge "Handle patching node /protected value with None"

This commit is contained in:
Zuul 2020-09-30 18:30:17 +00:00 committed by Gerrit Code Review
commit ceb45d7670
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes HTTP 500 when trying to unset the ``protected`` attribute via
the CLI.