~ubuntu-branches/ubuntu/trusty/swift/trusty-updates

« back to all changes in this revision

Viewing changes to swift/common/internal_client.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, James Page, Chuck Short
  • Date: 2013-08-13 10:37:13 UTC
  • mfrom: (1.2.21)
  • Revision ID: package-import@ubuntu.com-20130813103713-1ctbx4zifyljs2aq
Tags: 1.9.1-0ubuntu1
[ James Page ]
* d/control: Update VCS fields for new branch locations.

[ Chuck Short ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from sys import exc_info
21
21
from urllib import quote
22
22
import zlib
 
23
from gettext import gettext as _
23
24
from zlib import compressobj
24
25
 
25
26
from swift.common.http import HTTP_NOT_FOUND
181
182
                                    defaults to (2,).
182
183
 
183
184
        :returns : A dict of metadata with metadata_prefix stripped from keys.
 
185
                   Keys will be lowercase.
184
186
 
185
187
        :raises UnexpectedResponse: Exception raised when requests fail
186
188
                                    to get a response with an acceptable status
195
197
        metadata = {}
196
198
        for k, v in resp.headers.iteritems():
197
199
            if k.lower().startswith(metadata_prefix):
198
 
                metadata[k[len(metadata_prefix):]] = v
 
200
                metadata[k[len(metadata_prefix):].lower()] = v
199
201
        return metadata
200
202
 
201
203
    def _iter_items(
354
356
        :param acceptable_statuses: List of status for valid responses,
355
357
                                    defaults to (2,).
356
358
 
357
 
        :returns : Returns dict of account metadata.
 
359
        :returns : Returns dict of account metadata.  Keys will be lowercase.
358
360
 
359
361
        :raises UnexpectedResponse: Exception raised when requests fail
360
362
                                    to get a response with an acceptable status
467
469
        :param acceptable_statuses: List of status for valid responses,
468
470
                                    defaults to (2,).
469
471
 
470
 
        :returns : Returns dict of container metadata.
 
472
        :returns : Returns dict of container metadata.  Keys will be lowercase.
471
473
 
472
474
        :raises UnexpectedResponse: Exception raised when requests fail
473
475
                                    to get a response with an acceptable status