diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2020-12-22 16:46:33 +0000 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2020-12-22 17:11:32 +0000 |
| commit | 29a7c9afce32e7acbd40b9e4a73140ef9e05e7f3 (patch) | |
| tree | 883bbe45f97a63db310db8c77c62c288b53f5b6a /openstackclient/image | |
| parent | f5b185c35728025ebfd4145c800648b34476b775 (diff) | |
| download | python-openstackclient-29a7c9afce32e7acbd40b9e4a73140ef9e05e7f3.tar.gz | |
image: Unset properties rather than setting to None
Currently, we attempt to unset an image property by setting it to None.
This doesn't work for known properties and is rightly rejected by the
Glance API with the following error:
BadRequestException: 400: Client Error for url:
http://172.20.4.87/image/v2/images/368c5751-2b0b-4a38-a255-fd146fe52d31,
Bad Request
The solution is to actually unset the field by deleting it.
Change-Id: Ie156bedbe0f9244f82c81401679706f484caf9aa
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: #2008463
Task: #41493
Diffstat (limited to 'openstackclient/image')
| -rw-r--r-- | openstackclient/image/v2/image.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 58d92f51..60811522 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -1166,7 +1166,7 @@ class UnsetImage(command.Command): if parsed_args.properties: for k in parsed_args.properties: if k in image: - kwargs[k] = None + delattr(image, k) elif k in image.properties: # Since image is an "evil" object from SDK POV we need to # pass modified properties object, so that SDK can figure |
