~hudson-openstack/glance/milestone-proposed

« back to all changes in this revision

Viewing changes to glance/utils.py

  • Committer: Tarmac
  • Author(s): Brian Waldon, Yuriy Taraday, Justin Shepherd, Ewan Mellor, Thierry Carrez
  • Date: 2011-06-28 19:42:20 UTC
  • mfrom: (139.9.1 d2-merge)
  • Revision ID: tarmac-20110628194220-rhxw4nwelxeolztc
Merge diablo-2 development work

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    return headers
44
44
 
45
45
 
46
 
def inject_image_meta_into_headers(response, image_meta):
47
 
    """
48
 
    Given a response and mapping of image metadata, injects
49
 
    the Response with a set of HTTP headers for the image
50
 
    metadata. Each main image metadata field is injected
51
 
    as a HTTP header with key 'x-image-meta-<FIELD>' except
52
 
    for the properties field, which is further broken out
53
 
    into a set of 'x-image-meta-property-<KEY>' headers
54
 
 
55
 
    :param response: The Webob Response object
56
 
    :param image_meta: Mapping of image metadata
57
 
    """
58
 
    headers = image_meta_to_http_headers(image_meta)
59
 
 
60
 
    for k, v in headers.items():
61
 
        response.headers.add(k, v)
62
 
 
63
 
 
64
46
def get_image_meta_from_headers(response):
65
47
    """
66
48
    Processes HTTP headers from a supplied response that