From bb25330ddc07d9b433c9f8db7c52baed7020f0cf Mon Sep 17 00:00:00 2001 From: Jakob Meng Date: Fri, 22 Apr 2022 11:38:07 +0200 Subject: [PATCH] Renamed image property protected to is_protected OpenStack SDK removed support for the deprecated image property protected in commit afb49692 [1][2]. This replaces the usage of protected with is_protected in openstack.cloud.image but adds protected as an alias to not break backward compatibility for user code. This breaks backward compatibility to older OpenStack SDK releases though. Ref.: [1] https://github.com/openstack/openstacksdk/commit/afb49692f5bfab259af8c594eedbddcb52cbde81 [2] https://review.opendev.org/c/openstack/openstacksdk/+/820926 Change-Id: I5044c927e90c650234fbc22375f44e6841a485a1 --- plugins/modules/image.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/modules/image.py b/plugins/modules/image.py index 387197a9..52f9d6b0 100644 --- a/plugins/modules/image.py +++ b/plugins/modules/image.py @@ -57,9 +57,10 @@ options: - Whether the image can be accessed publicly. Note that publicizing an image requires admin role by default. type: bool default: false - protected: + is_protected: description: - Prevent image from being deleted + aliases: ['protected'] type: bool default: false filename: @@ -173,7 +174,7 @@ class ImageModule(OpenStackModule): min_disk=dict(type='int', default=0), min_ram=dict(type='int', default=0), is_public=dict(type='bool', default=False), - protected=dict(type='bool', default=False), + is_protected=dict(type='bool', default=False, aliases=['protected']), filename=dict(type='str'), ramdisk=dict(type='str'), kernel=dict(type='str'), @@ -210,7 +211,7 @@ class ImageModule(OpenStackModule): wait=self.params['wait'], timeout=self.params['timeout'], is_public=self.params['is_public'], - protected=self.params['protected'], + is_protected=self.params['is_protected'], min_disk=self.params['min_disk'], min_ram=self.params['min_ram'], volume=self.params['volume'], @@ -225,7 +226,7 @@ class ImageModule(OpenStackModule): image=image, kernel=self.params['kernel'], ramdisk=self.params['ramdisk'], - protected=self.params['protected'], + is_protected=self.params['is_protected'], **self.params['properties']) if self.params['tags']: self.conn.image.update_image(image.id, tags=self.params['tags'])