Files
ansible-collections-openstack/changelogs/fragments/image_web_download.yaml
T
Moritz Tanner 34a99f549b image: do a web-download import when uri is given
The module documents and accepts import_method and uri, but nothing ever
acts on them for a URL-based import. Its only import_image() call is
hardcoded to glance-direct, so asking Glance to fetch an image itself is
not possible.

Worse, the two options are listed in attr_params, so they are handed to
conn.create_image() as unrecognised keyword arguments and end up stored
on the image as arbitrary properties. With no filename the create call
then reaches the direct upload endpoint with no data, which Glance
rejects:

  HttpException: 415: Client Error for url:
  .../v2/images/<id>/file, Unsupported Media Type
  Image disk_format qcow2 does not match stream data raw

Import a queued image from its uri instead, defaulting the method to
web-download, and drop the three behavioural options from attr_params so
they stop becoming image properties. When creating the image, do not let
create_image() wait for it to become active, since it stays queued until
the import is started.

Remove glance-download from the import_method choices. The module never
used it. The glance-download method takes a remote region and a remote
image ID, and the module has no options for these yet.

Closes-Bug: #2167999
Change-Id: I11fa064567c36012cd51c78e4bca2c46152990d3
Signed-off-by: Moritz Tanner <moritz.tanner@linbit.com>
2026-10-22 15:12:20 +02:00

11 lines
495 B
YAML

---
bugfixes:
- modules/image.py now performs a web-download import when ``uri`` is given,
instead of ignoring ``uri`` and ``import_method`` and attempting a direct
upload with no data.
- modules/image.py no longer passes ``uri``, ``import_method`` and
``use_import`` to the image create call, where they were stored on the
image as arbitrary properties.
- modules/image.py no longer accepts ``import_method=glance-download``.
The module never implemented this method.