← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1158157] Re: List image with params as limit = 1 using XML interface is returning an extra tag

 

See https://bugs.launchpad.net/nova/+bug/1158145

** Changed in: nova
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1158157

Title:
   List image with params as limit = 1 using XML interface is returning
  an extra tag

Status in OpenStack Compute (Nova):
  Invalid

Bug description:
  While trying to list images using filter as limit = 1

  http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images?limit=1

  The xml response is returning an extra tag "<atom:link
  href="http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images?limit=1&amp;marker=8e6f2a43
  -5a6c-459f-8e0f-d72808c6ea06" rel="next"/>"

  XML Response:

  <?xml version='1.0' encoding='UTF-8'?>
  <images xmlns:atom="http://www.w3.org/2005/Atom"; xmlns="http://docs.openstack.org/compute/api/v1.1";><image name="cirros-0.3.1-x86_64-uec" id="8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"><atom:link href="http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"; rel="self"/><atom:link href="http://10.233.52.230:8774/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"; rel="bookmark"/><atom:link href="http://10.233.52.230:9292/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"; type="application/vnd.openstack.image" rel="alternate"/></image><atom:link href="http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images?limit=1&amp;marker=8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"; rel="next"/></images>

  The result of parse the above body to JSON is as below

  XML_parse_body = [{'name': 'cirros-0.3.1-x86_64-uec', 'links':
  [{'href':
  'http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43
  -5a6c-459f-8e0f-d72808c6ea06', 'rel': 'self'}, {'href':
  'http://10.233.52.230:8774/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43
  -5a6c-459f-8e0f-d72808c6ea06', 'rel': 'bookmark'}, {'href':
  'http://10.233.52.230:9292/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43
  -5a6c-459f-8e0f-d72808c6ea06', 'type':
  'application/vnd.openstack.image', 'rel': 'alternate'}], 'id':
  '8e6f2a43-5a6c-459f-8e0f-d72808c6ea06'}, {'href':
  'http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images?limit=1&marker=8e6f2a43
  -5a6c-459f-8e0f-d72808c6ea06', 'rel': 'next'}]

  len(XML_parse_body) = 2
  Hence the lenght is resulting as "2" but not 1

  Where as in the case of JSON response it is as below
  JSON_resp_body = [{u'id': u'8e6f2a43-5a6c-459f-8e0f-d72808c6ea06', u'links': [{u'href': u'http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06', u'rel': u'self'}, {u'href': u'http://10.233.52.230:8774/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06', u'rel': u'bookmark'}, {u'href': u'http://10.233.52.230:9292/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06', u'type': u'application/vnd.openstack.image', u'rel': u'alternate'}], u'name': u'cirros-0.3.1-x86_64-uec'}]

  len(JSON_resp_body) = 1

  This is resulting a failure in execution of test case (list images
  with filters) for both XML and JSON interfaces simultaneously.

  It is as expected in the case of list images with details

  url =
  http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images/detail?limit=1

  XML Response

  <?xml version='1.0' encoding='UTF-8'?>
  <images xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1"; xmlns:OS-EXT-IMG-SIZE="http://docs.openstack.org/compute/ext/image_size/api/v1.1"; xmlns:atom="http://www.w3.org/2005/Atom"; xmlns="http://docs.openstack.org/compute/api/v1.1";><image status="ACTIVE" updated="2013-03-01T15:52:38Z" name="cirros-0.3.1-x86_64-uec" created="2013-03-01T15:52:37Z" minDisk="0" progress="100" minRam="0" id="8e6f2a43-5a6c-459f-8e0f-d72808c6ea06" OS-EXT-IMG-SIZE:size="25165824"><metadata><meta key="kernel_id">906e734d-95aa-4acb-bee0-4eff2fc73f30</meta><meta key="ramdisk_id">edafffbf-8a90-4d06-84a0-7e32f98655b8</meta></metadata><atom:link href="http://10.233.52.230:8774/v2/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"; rel="self"/><atom:link href="http://10.233.52.230:8774/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"; rel="bookmark"/><atom:link href="http://10.233.52.230:9292/6bbd80f698a241d58aa5dfebcd073b8b/images/8e6f2a43-5a6c-459f-8e0f-d72808c6ea06"; type="application/vnd.openstack.image" rel="alternate"/></image></images>

  there is one element under images.

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