From 474b3804eb918d3a6be6360e5d53659754ae6be6 Mon Sep 17 00:00:00 2001 From: Jay Jahns Date: Mon, 14 Oct 2024 23:19:59 -0500 Subject: [PATCH] Enable glance-direct interop image import Adds the use_import parameter to enable interop import so images that need transformation by glance can have it, such as format conversion. Closes-Bug: 2084481 Change-Id: I39d1e94ff8ab9f0e0b99c1cef9a814eef0b1f060 --- plugins/modules/image.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/modules/image.py b/plugins/modules/image.py index 48527de1..cea82f61 100644 --- a/plugins/modules/image.py +++ b/plugins/modules/image.py @@ -122,6 +122,12 @@ options: - I(volume) has been deprecated. Use module M(openstack.cloud.volume) instead. type: str + use_import: + description: + - Use the 'glance-direct' method of the interoperable image import mechanism. + - Should only be used when needed, such as when the user needs the cloud to + transform image format. + type: bool extends_documentation_fragment: - openstack.cloud.openstack ''' @@ -392,6 +398,7 @@ class ImageModule(OpenStackModule): tags=dict(type='list', default=[], elements='str'), visibility=dict(choices=['public', 'private', 'shared', 'community']), volume=dict(), + use_import=dict(type='bool'), ) module_kwargs = dict( @@ -404,7 +411,8 @@ class ImageModule(OpenStackModule): # resource attributes obtainable directly from params attr_params = ('id', 'name', 'filename', 'disk_format', 'container_format', 'wait', 'timeout', 'is_public', - 'is_protected', 'min_disk', 'min_ram', 'volume', 'tags') + 'is_protected', 'min_disk', 'min_ram', 'volume', 'tags', + 'use_import') def _resolve_visibility(self): """resolve a visibility value to be compatible with older versions"""