← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2028895] Re: Interoperable Image Import in glance documented format for inject not working as expected

 

Reviewed:  https://review.opendev.org/c/openstack/glance/+/890423
Committed: https://opendev.org/openstack/glance/commit/dd9b3156cd1c5341b01c5befe2a2d13bab6e8d01
Submitter: "Zuul (22348)"
Branch:    master

commit dd9b3156cd1c5341b01c5befe2a2d13bab6e8d01
Author: Cyril Roelandt <cyril@xxxxxxxxxx>
Date:   Wed Dec 13 04:13:40 2023 +0100

    inject_image_metadata plugin: Fix documentation
    
    The properties and values given to the "inject" option must not be
    quoted, otherwise the quotes become part of the values themselves.
    
    Change-Id: Ibcb8b8488253f459f40e6d34f4221832b7ff3839
    Closes-Bug: #2028895


** Changed in: glance
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/2028895

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

Status in Glance:
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/2028895/+subscriptions



References