Add support of image format conversion on importing
Optinally enable conversion of images to raw format when uploading images to Glance. Only supported when "image_conversion" is enabled in Glance. This is an equivalent change to the one in simplestreams: https://git.launchpad.net/simplestreams/commit/?id=cbc0ac9 Closes-Bug: #1889729 Change-Id: Id15fab364c27242347c520b959065c490e4da6b6
This commit is contained in:
parent
c6a07458dc
commit
536540781a
@ -138,3 +138,9 @@ options:
|
|||||||
OpenStack mostly defaults to using public endpoints for internal
|
OpenStack mostly defaults to using public endpoints for internal
|
||||||
communication between services. If set to True this option will
|
communication between services. If set to True this option will
|
||||||
configure services to use internal endpoints where possible.
|
configure services to use internal endpoints where possible.
|
||||||
|
image_import_conversion:
|
||||||
|
type: boolean
|
||||||
|
default: False
|
||||||
|
description: |
|
||||||
|
Enable conversion of images to raw format when uploading images to Glance.
|
||||||
|
Only supported when "image_conversion" is enabled in Glance.
|
||||||
|
@ -299,6 +299,10 @@ def do_sync(ksc, charm_conf):
|
|||||||
'--custom-property',
|
'--custom-property',
|
||||||
custom_property
|
custom_property
|
||||||
]
|
]
|
||||||
|
if charm_conf.get('image_import_conversion', False):
|
||||||
|
sync_command += [
|
||||||
|
'--image-import-conversion'
|
||||||
|
]
|
||||||
|
|
||||||
if charm_conf.get('set_latest_property', False):
|
if charm_conf.get('set_latest_property', False):
|
||||||
sync_command += [
|
sync_command += [
|
||||||
|
@ -183,7 +183,8 @@ class MirrorsConfigServiceContext(OSContextGenerator):
|
|||||||
user_agent=config['user_agent'],
|
user_agent=config['user_agent'],
|
||||||
custom_properties=config['custom_properties'],
|
custom_properties=config['custom_properties'],
|
||||||
hypervisor_mapping=config['hypervisor_mapping'],
|
hypervisor_mapping=config['hypervisor_mapping'],
|
||||||
set_latest_property=config['set_latest_property'])
|
set_latest_property=config['set_latest_property'],
|
||||||
|
image_import_conversion=config['image_import_conversion'])
|
||||||
|
|
||||||
|
|
||||||
def ensure_perms():
|
def ensure_perms():
|
||||||
|
@ -9,6 +9,7 @@ region: {{ region }}
|
|||||||
cloud_name: {{ cloud_name }}
|
cloud_name: {{ cloud_name }}
|
||||||
content_id_template: {{ content_id_template }}
|
content_id_template: {{ content_id_template }}
|
||||||
hypervisor_mapping: {{ hypervisor_mapping }}
|
hypervisor_mapping: {{ hypervisor_mapping }}
|
||||||
|
image_import_conversion: {{ image_import_conversion }}
|
||||||
{% if custom_properties %}
|
{% if custom_properties %}
|
||||||
custom_properties: {{ custom_properties }}
|
custom_properties: {{ custom_properties }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user