Interoperable Image Import in glance documented format for inject not working as expected

Bug #2028895 reported by Rafael Lopez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
In Progress
Undecided
Cyril Roelandt

Bug Description

According to the documentation, the correct way to specify custom import image metadata properties is:
"inject is a comma-separated list of properties and values that will be injected into the image record for the imported image. Each property and value should be quoted and separated by a colon (‘:’) as shown in the example above."

With the example being:
inject = "property1":"value1","property2":"value2",...

When specifying properties in this way the resulting properties in the imported image look like this:
properties | "property2"='"value2"', "property3"='"value3', os_glance_failed_import='', os_glance_importing_to_stores='', os_hash_algo='sha512', os_hash_value='cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images/proptest1', owner_specified.openstack.sha256='', property1"='"value1"', stores='local'

If you look closely at each of the properties, the quotes are inconsistent:
"property2"='"value2"'
"property3"='"value3
property1"='"value1"'

Conversely, if you use the following (no quotes):
inject = property1:value1,property2:value2,property3:value3

properties | os_glance_failed_import='', os_glance_importing_to_stores='', os_hash_algo='sha512', os_hash_value='cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images/proptest2', owner_specified.openstack.sha256='', property1='value1', property2='value2', property3='value3', stores='local'

Now it looks better:
property1='value1'
property2='value2'
property3='value3'

The resulting quotes using this format seem to match the other standard properties, ie. key='value' and I suspect what we are going for. I'm unclear if this is a parser issue or a documentation issue.

-----------------------------------
Release: 27.0.0.0b3.dev5 on 2022-08-30 13:35:51
SHA: 46c30f0b6db6ed6a86b1b84e69748025ad9050c6
Source: https://opendev.org/openstack/glance/src/doc/source/admin/interoperable-image-import.rst
URL: https://docs.openstack.org/glance/latest/admin/interoperable-image-import.html

summary: Interoperable Image Import in glance documented format for inject not
- working
+ working as expected
description: updated
Changed in glance:
assignee: nobody → Cyril Roelandt (cyril-roelandt)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/glance/+/890423

Changed in glance:
status: Confirmed → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.