API break: image metadata format changed in Newton

Bug #1627639 reported by Luigi Toscano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sahara
Fix Released
Critical
Vitalii Gridnev
Newton
Fix Released
Critical
Vitalii Gridnev

Bug Description

Apparently the server returns the metadata for an image registered in Sahara in a different format starting from Newton. This is (if confirmed) an API breakage and should be reverted before the final release.

The following program works when run against Mitaka, but not against Newton, both with saharaclient 0.13 (mitaka) and 0.18 (newton).

---------------------------------
#!/usr/bin/python

from keystoneauth1.identity import v3
from keystoneauth1 import session
from saharaclient import client as sahara_client

def main():
    auth = v3.Password(auth_url='http://localhost:5000/v3',
                       username='demo',
                       password='secret',
                       project_name='demo',
                       user_domain_name='default',
                       project_domain_name='default')

    ses = session.Session(auth=auth)

    client = sahara_client.Client('1.1', session=ses)

    # ID of an image registered as Sahara image with some tags
    image_id = '41360709-596d-4478-a3ad-38b1f44fb7b8'
    reg_image = client.images.get(image_id)

    print reg_image.metadata

if __name__ == '__main__':
    main()
---------------------------------

Returned value when run against Mitaka:
{u'_sahara_username': u'cirros', u'_sahara_tag_vanilla': u'True', u'_sahara_tag_2.7.1': u'True'}

Returned value when run against Newton:
Traceback (most recent call last):
  File "./saharaclient_metadatabreak1.py", line 28, in <module>
    main()
  File "./saharaclient_metadatabreak1.py", line 24, in main
    print reg_image.metadata
AttributeError: 'Image' object has no attribute 'metadata'

Apparently on Newton the tags are not in a separate metadata dict, but represented as the other values, inside reg_image.

The breakage seems to trace back to this change:
https://review.openstack.org/#/c/334569/

For the record, this was found by trying to unblock https://bugs.launchpad.net/sahara/+bug/1430252

Changed in sahara:
importance: Undecided → Critical
assignee: nobody → Vitaly Gridnev (vgridnev)
milestone: none → ocata-1
status: New → Confirmed
Changed in sahara:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to sahara (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/376519

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sahara (master)

Reviewed: https://review.openstack.org/376414
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=d0c79d621dfad1291e61c0aba03f0d6e2baa04d0
Submitter: Jenkins
Branch: master

commit d0c79d621dfad1291e61c0aba03f0d6e2baa04d0
Author: Vitaly Gridnev <email address hidden>
Date: Mon Sep 26 14:33:40 2016 +0300

    Fix API compatibility issue

    Fixing image registry API to satisfy current API
    documentation for GET/LIST methods.

    Closes-bug: 1627639
    Change-Id: I3bc91f4bdf09d50501a7b79609a2a2c506fc1b3c

Changed in sahara:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sahara (stable/newton)

Reviewed: https://review.openstack.org/376519
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=bb96d84cac2f093616b22df46ff42c9229c49789
Submitter: Jenkins
Branch: stable/newton

commit bb96d84cac2f093616b22df46ff42c9229c49789
Author: Vitaly Gridnev <email address hidden>
Date: Mon Sep 26 14:33:40 2016 +0300

    Fix API compatibility issue

    Fixing image registry API to satisfy current API
    documentation for GET/LIST methods.

    Closes-bug: 1627639
    Change-Id: I3bc91f4bdf09d50501a7b79609a2a2c506fc1b3c

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/sahara 5.0.0.0rc2

This issue was fixed in the openstack/sahara 5.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/sahara 5.0.0

This issue was fixed in the openstack/sahara 5.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/sahara 6.0.0.0b1

This issue was fixed in the openstack/sahara 6.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/sahara 5.0.0

This issue was fixed in the openstack/sahara 5.0.0 release.

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.