Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing error when Glance V2 image contains optional locations #1096

Merged
merged 2 commits into from
Nov 21, 2017

Conversation

baseman79
Copy link
Contributor

@baseman79 baseman79 commented Oct 6, 2017

Seeing parsing error when image from Glance V2 contains "locations"

According to Glance API V2:

A list of objects, each of which describes an image location. Each object contains a url key, whose value is a URL specifying a location, and a metadata key, whose value is a dict of key:value pairs containing information appropriate to the use of whatever external store is indicated by the URL.

Add a new Location object, and replace the locations from List to List

  "images": [{
    "container_format": "bare",
    "min_ram": 0,
    "updated_at": "2017-10-05T07:37:07Z",
    "file": "/v2/images/xxxx/file",
    "owner": "xxxx",
    "id": "xxxx",
    "size": 10000,
    "self": "/v2/images/xxxx",
    "disk_format": "qcow2",
    "direct_url": "rbd://xxxx/images/xxxx/snap",
    "hw_disk_bus": "virtio",
    "schema": "/v2/schemas/image",
    "status": "active",
    "tags": [],
    "visibility": "public",
    "locations": [{
      "url": "rbd://xxxx/images/xxxx/snap",
      "metadata": {}
    }],
    "min_disk": 0,
    "virtual_size": null,
    "name": "xxx",
    "checksum": "xxx",
    "created_at": "2017-10-05T07:37:00Z",
    "hw_vif_model": "virtio",
    "protected": false
  }],
  "schema": "/v2/schemas/images",
  "first": "/v2/images?name=aselvana-vnfd-deployment-control-function"
}

@vinodborole
Copy link
Contributor

@baseman79 thanks for the fix, can you please add a test case for this?

@vinodborole vinodborole added the bug label Oct 9, 2017
@baseman79
Copy link
Contributor Author

@vinodborole sure thing, will add one shortly, thx

@auhlig auhlig merged commit bcf3a13 into ContainX:master Nov 21, 2017
@auhlig auhlig added this to the 3.1.1 Release milestone Nov 21, 2017
@auhlig
Copy link
Member

auhlig commented Nov 21, 2017

Thanks @baseman79

posox added a commit to posox/clouddriver that referenced this pull request Aug 27, 2018
It's a workaround for issue in Openstack4j library, locations cannot be
used without fix ContainX/openstack4j#1096

Spinnaker issue: spinnaker/spinnaker#3018
posox added a commit to posox/clouddriver that referenced this pull request Aug 27, 2018
It's a workaround for issue in Openstack4j library, locations cannot be
used without fix ContainX/openstack4j#1096

Spinnaker issue: spinnaker/spinnaker#3018
posox added a commit to posox/clouddriver that referenced this pull request Aug 31, 2018
It's a workaround for issue in Openstack4j library, locations cannot be
used without fix ContainX/openstack4j#1096

Spinnaker issue: spinnaker/spinnaker#3018
tomaslin pushed a commit to spinnaker/clouddriver that referenced this pull request Aug 31, 2018
…2912)

It's a workaround for issue in Openstack4j library, locations cannot be
used without fix ContainX/openstack4j#1096

Spinnaker issue: spinnaker/spinnaker#3018
clanesf pushed a commit to clanesf/clouddriver that referenced this pull request Dec 8, 2018
…pinnaker#2912)

It's a workaround for issue in Openstack4j library, locations cannot be
used without fix ContainX/openstack4j#1096

Spinnaker issue: spinnaker/spinnaker#3018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants