← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1412304] [NEW] can not update locations

 

Public bug reported:

If location-update using below cli then error occured and locations status changed to deleted.
Believe it or not, the file was also deleted.
I want to update only metadata of the location.

glance location-update (v2)
usage: glance --os-image-api-version 2 location-update --url <URL> [--metadata <STRING>] <ID>

Example:
glance --debug --os-image-api-version 2  location-update --url file:///var/lib/glance/images/7059e766-aa3f-4af9-83f4-c482177533e5 --metadata '{"foo":"bar"}' 7059e766-aa3f-4af9-83f4-c482177533e5

Error logs:
Request returned failure status 400.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 608, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 304, in do_location_update
    image = gc.images.update_location(args.id, args.url, metadata)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 284, in update_location
    self._send_image_update_request(image_id, patches)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 209, in _send_image_update_request
    self.http_client.patch(url, headers=hdrs, data=json.dumps(patch_body))
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 277, in patch
    return self._request('PATCH', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 236, in _request
    raise exc.from_response(resp, resp.content)
HTTPBadRequest: <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Invalid location<br /><br />

 </body>
</html> (HTTP 400)
<html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Invalid location<br /><br />

 </body>
</html> (HTTP 400)

** Affects: glance
     Importance: Undecided
         Status: New

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

Title:
  can not update locations

Status in OpenStack Image Registry and Delivery Service (Glance):
  New

Bug description:
  If location-update using below cli then error occured and locations status changed to deleted.
  Believe it or not, the file was also deleted.
  I want to update only metadata of the location.

  glance location-update (v2)
  usage: glance --os-image-api-version 2 location-update --url <URL> [--metadata <STRING>] <ID>

  Example:
  glance --debug --os-image-api-version 2  location-update --url file:///var/lib/glance/images/7059e766-aa3f-4af9-83f4-c482177533e5 --metadata '{"foo":"bar"}' 7059e766-aa3f-4af9-83f4-c482177533e5

  Error logs:
  Request returned failure status 400.
  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 608, in main
      args.func(client, args)
    File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 304, in do_location_update
      image = gc.images.update_location(args.id, args.url, metadata)
    File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 284, in update_location
      self._send_image_update_request(image_id, patches)
    File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 209, in _send_image_update_request
      self.http_client.patch(url, headers=hdrs, data=json.dumps(patch_body))
    File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 277, in patch
      return self._request('PATCH', url, **kwargs)
    File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 236, in _request
      raise exc.from_response(resp, resp.content)
  HTTPBadRequest: <html>
   <head>
    <title>400 Bad Request</title>
   </head>
   <body>
    <h1>400 Bad Request</h1>
    Invalid location<br /><br />

   </body>
  </html> (HTTP 400)
  <html>
   <head>
    <title>400 Bad Request</title>
   </head>
   <body>
    <h1>400 Bad Request</h1>
    Invalid location<br /><br />

   </body>
  </html> (HTTP 400)

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


Follow ups

References