<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/python-swiftclient.git/swiftclient/utils.py, branch mitaka-eol</title>
<subtitle>opendev.org: openstack/python-swiftclient.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/'/>
<entry>
<title>Use bulk-delete middleware when available</title>
<updated>2016-01-12T23:40:57+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2015-06-11T21:33:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=7a1e192803b8f4b739c9c3086bbfdc9a9c8d6753'/>
<id>7a1e192803b8f4b739c9c3086bbfdc9a9c8d6753</id>
<content type='text'>
When issuing `delete` commands that would require three or more
individual deletes, check whether the cluster supports bulk deletes
and use that if it's available.

Additionally, a new option is added to the `delete` command:

  * --prefix &lt;prefix&gt;

    Delete all objects that start with &lt;prefix&gt;. This is similar to the
    --prefix option for the `list` command.

Example:

$ swift delete c --prefix obj_prefix/

    ...will delete from container "c" all objects whose name begins with
    "obj_prefix/", such as "obj_prefix/foo" and "obj_prefix/bar".

Change-Id: I6b9504848d6ef562cf4f570bbcd17db4e3da8264
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When issuing `delete` commands that would require three or more
individual deletes, check whether the cluster supports bulk deletes
and use that if it's available.

Additionally, a new option is added to the `delete` command:

  * --prefix &lt;prefix&gt;

    Delete all objects that start with &lt;prefix&gt;. This is similar to the
    --prefix option for the `list` command.

Example:

$ swift delete c --prefix obj_prefix/

    ...will delete from container "c" all objects whose name begins with
    "obj_prefix/", such as "obj_prefix/foo" and "obj_prefix/bar".

Change-Id: I6b9504848d6ef562cf4f570bbcd17db4e3da8264
</pre>
</div>
</content>
</entry>
<entry>
<title>Retry file uploads via SwiftService</title>
<updated>2016-01-11T19:12:13+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2015-09-23T17:42:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=d4157ce5b5eeeebb3516092de995cee20025a5c1'/>
<id>d4157ce5b5eeeebb3516092de995cee20025a5c1</id>
<content type='text'>
When we introduced LengthWrapper, we neglected to make it resettable. As
a result, upload failures result in errors like:

    put_object(...) failure and no ability to reset contents for reupload.

Now, LengthWrappers will be resettable if their _readable has seek/tell.

Related-Change: I6c8bc1366dfb591a26d934a30cd21c9e6b9a04ce
Change-Id: I21f43f06e8c78b24d1fc081efedf2687942e042f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we introduced LengthWrapper, we neglected to make it resettable. As
a result, upload failures result in errors like:

    put_object(...) failure and no ability to reset contents for reupload.

Now, LengthWrappers will be resettable if their _readable has seek/tell.

Related-Change: I6c8bc1366dfb591a26d934a30cd21c9e6b9a04ce
Change-Id: I21f43f06e8c78b24d1fc081efedf2687942e042f
</pre>
</div>
</content>
</entry>
<entry>
<title>Wrap raw iterators to ensure we send entire contents to server</title>
<updated>2015-12-30T19:56:36+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2015-12-30T19:15:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=39b1a31d8a187534f54e32e9aec2cb2bb839a390'/>
<id>39b1a31d8a187534f54e32e9aec2cb2bb839a390</id>
<content type='text'>
Currently, if you attempt to stream an upload from an iterator, as in

    def data():
        yield 'foo'
        yield ''
        yield 'bar'
    conn.put_object('c', 'o', data())

... requests will faithfully emit a zero-length chunk, ending the
transfer. Swift will then close the connection, possibly (if Connection:
keep-alive was set) after attempting to parse the next chunk as a new
request.

Now, Swift will receive all of the bytes from the iterable, and any
zero-byte chunks will be ignored.

This will be fixed in requests [1], but not until an eventual 3.0.0
release.

[1] https://github.com/kennethreitz/requests/pull/2631

Change-Id: I19579ed7a0181ac3f488433e7c1839f7f7a040b8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, if you attempt to stream an upload from an iterator, as in

    def data():
        yield 'foo'
        yield ''
        yield 'bar'
    conn.put_object('c', 'o', data())

... requests will faithfully emit a zero-length chunk, ending the
transfer. Swift will then close the connection, possibly (if Connection:
keep-alive was set) after attempting to parse the next chunk as a new
request.

Now, Swift will receive all of the bytes from the iterable, and any
zero-byte chunks will be ignored.

This will be fixed in requests [1], but not until an eventual 3.0.0
release.

[1] https://github.com/kennethreitz/requests/pull/2631

Change-Id: I19579ed7a0181ac3f488433e7c1839f7f7a040b8
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "enable autodocumentation for utils module; docstring fixes"</title>
<updated>2015-10-29T06:09:46+00:00</updated>
<author>
<name>Jenkins</name>
<email>jenkins@review.openstack.org</email>
</author>
<published>2015-10-29T06:09:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=1c649cc0d87cd71335408070e0ad4fe137212847'/>
<id>1c649cc0d87cd71335408070e0ad4fe137212847</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Miscellaneous (mostly test) cleanup</title>
<updated>2015-10-08T05:33:42+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2015-09-10T00:41:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=9fed7ed5e1f6dd3e589a35e3ee4abecb676f2188'/>
<id>9fed7ed5e1f6dd3e589a35e3ee4abecb676f2188</id>
<content type='text'>
 * Always use testtools.TestCase, since we're relying on testtools
 * Always use mock (as opposed to unittest.mock) since we're relying on
   mock
 * Add note about when a missing logging handler was added
 * Stop %-formatting the giant usage string that doesn't actually need
   any formatting
 * Prefer assertIs, assertIn, assertIsInstance over assertTrue
 * Use else-self.fail instead of sentinel values
 * Check resp.get('error') is None before checking resp['success'] is
   True, so test failures actually tell you something useful
 * Tighten some isinstance assertions
 * Import MockHttpTest from correct location
 * Only populate clean_os_environ once
 * Use setUp for setup, not __init__
 * Replace assertIn(key, dict) and assertEqual(foo, dict[key]) with
   assertEqual(foo, dict.get(key)) when key is a literal and foo is not
   None
 * Use mock.patch.object instead of manually patching for tests
 * Use six.binary_type instead of type(''.encode('utf-8'))
 * Stop shadowing builtin bytes
 * Reclaim some margin
 * Stop checking the return-type of encode_utf8; we already know it's
   bytes

Change-Id: I2138ea553378ce88810b7353147c8645a8f8c90e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 * Always use testtools.TestCase, since we're relying on testtools
 * Always use mock (as opposed to unittest.mock) since we're relying on
   mock
 * Add note about when a missing logging handler was added
 * Stop %-formatting the giant usage string that doesn't actually need
   any formatting
 * Prefer assertIs, assertIn, assertIsInstance over assertTrue
 * Use else-self.fail instead of sentinel values
 * Check resp.get('error') is None before checking resp['success'] is
   True, so test failures actually tell you something useful
 * Tighten some isinstance assertions
 * Import MockHttpTest from correct location
 * Only populate clean_os_environ once
 * Use setUp for setup, not __init__
 * Replace assertIn(key, dict) and assertEqual(foo, dict[key]) with
   assertEqual(foo, dict.get(key)) when key is a literal and foo is not
   None
 * Use mock.patch.object instead of manually patching for tests
 * Use six.binary_type instead of type(''.encode('utf-8'))
 * Stop shadowing builtin bytes
 * Reclaim some margin
 * Stop checking the return-type of encode_utf8; we already know it's
   bytes

Change-Id: I2138ea553378ce88810b7353147c8645a8f8c90e
</pre>
</div>
</content>
</entry>
<entry>
<title>enable autodocumentation for utils module; docstring fixes</title>
<updated>2015-09-10T22:19:26+00:00</updated>
<author>
<name>Zack M. Davis</name>
<email>zdavis@swiftstack.com</email>
</author>
<published>2015-09-10T21:37:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=6b3638ecec3049023420dce16f06549585e2fb8b'/>
<id>6b3638ecec3049023420dce16f06549585e2fb8b</id>
<content type='text'>
This commit adds the utils module to those for which Sphinx
automatically generates documentation from docstrings. (Many of the
functions here may be of little interest to users, but
`generate_temp_url`, at least, definitely deserves to be in the
documentation; in this way, this commit can be seen as a spiritual
companion to ca70dd9e.)

Also, a few markup errors and perceived infelicities in existing
docstrings are amended.

Change-Id: I8c66a23cb359d7dd9302a16459fad9825fedb690
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds the utils module to those for which Sphinx
automatically generates documentation from docstrings. (Many of the
functions here may be of little interest to users, but
`generate_temp_url`, at least, definitely deserves to be in the
documentation; in this way, this commit can be seen as a spiritual
companion to ca70dd9e.)

Also, a few markup errors and perceived infelicities in existing
docstrings are amended.

Change-Id: I8c66a23cb359d7dd9302a16459fad9825fedb690
</pre>
</div>
</content>
</entry>
<entry>
<title>absolute expiry option for tempURL generation</title>
<updated>2015-09-04T21:57:30+00:00</updated>
<author>
<name>Zack M. Davis</name>
<email>zdavis@swiftstack.com</email>
</author>
<published>2015-09-04T21:57:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=52d39bebc11979fa1be5090ff75466710638e561'/>
<id>52d39bebc11979fa1be5090ff75466710638e561</id>
<content type='text'>
The `tempurl` subcommand's second positional argument is called
`seconds` and has heretofore interpreted as the number of seconds for
which the tempURL should be valid, counting from the moment of running
the command. This is indeed a common, if not the most common,
use-case. But some users, occasionally, might want to generate a tempURL
that expires at some particular ("absolute") time, rather than a
particular amount of time relative to the moment of happening to run the
command. (One might make an analogy to the way in which Swift's expiring
object support supports an `X-Delete-At` header in addition to
`X-Delete-After`—and it's the former that must be regarded as
ontologically prior.) Thus, this commit adds an `--absolute` optional
argument to the `tempurl` subcommand; if present, the `seconds` argument
will be interpreted as a Unix timestamp of when the tempURL should be
expire, rather than a duration for which the tempURL should be valid
starting from "now".

Change-Id: If9ded96f2799800958d5063127f3de812f50ef06
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `tempurl` subcommand's second positional argument is called
`seconds` and has heretofore interpreted as the number of seconds for
which the tempURL should be valid, counting from the moment of running
the command. This is indeed a common, if not the most common,
use-case. But some users, occasionally, might want to generate a tempURL
that expires at some particular ("absolute") time, rather than a
particular amount of time relative to the moment of happening to run the
command. (One might make an analogy to the way in which Swift's expiring
object support supports an `X-Delete-At` header in addition to
`X-Delete-After`—and it's the former that must be regarded as
ontologically prior.) Thus, this commit adds an `--absolute` optional
argument to the `tempurl` subcommand; if present, the `seconds` argument
will be interpreted as a Unix timestamp of when the tempURL should be
expire, rather than a duration for which the tempURL should be valid
starting from "now".

Change-Id: If9ded96f2799800958d5063127f3de812f50ef06
</pre>
</div>
</content>
</entry>
<entry>
<title>Log and report trace on service operation fails</title>
<updated>2015-08-31T21:03:26+00:00</updated>
<author>
<name>Joel Wright</name>
<email>joel.wright@sohonet.com</email>
</author>
<published>2015-04-05T15:48:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=3c0289844f73b9e685b8443c90b0ca80e0b18f28'/>
<id>3c0289844f73b9e685b8443c90b0ca80e0b18f28</id>
<content type='text'>
This patch adds exception logging to the swift service API. Each
operation that results in failure of any operation will now log
the exception as well as report a timestamp and full stack trace
in the results returned by the service API calls.

Change-Id: I7336b28354e7740ea7d048bdf355e3c1a1b4436c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds exception logging to the swift service API. Each
operation that results in failure of any operation will now log
the exception as well as report a timestamp and full stack trace
in the results returned by the service API calls.

Change-Id: I7336b28354e7740ea7d048bdf355e3c1a1b4436c
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove simplejson dependency</title>
<updated>2015-05-21T01:14:53+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2015-05-15T00:09:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=317df7e527c174695e184f8250f5f743ac91f0f2'/>
<id>317df7e527c174695e184f8250f5f743ac91f0f2</id>
<content type='text'>
In addition to removing an unnecessary dependency, this closes another
hole that was allowing raw bytes to appear in user-facing messages.

Change-Id: Ia0b76426a38e5a5c368c4c7e7ba2aef286758aca
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In addition to removing an unnecessary dependency, this closes another
hole that was allowing raw bytes to appear in user-facing messages.

Change-Id: Ia0b76426a38e5a5c368c4c7e7ba2aef286758aca
</pre>
</div>
</content>
</entry>
<entry>
<title>Add improvements to MD5 validation.</title>
<updated>2015-03-04T14:01:55+00:00</updated>
<author>
<name>Daniel Wakefield</name>
<email>daniel.wakefield@hp.com</email>
</author>
<published>2015-03-04T14:01:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-swiftclient.git/commit/?id=13780f37c3f5e5f18f10f131d1ef39c010457e87'/>
<id>13780f37c3f5e5f18f10f131d1ef39c010457e87</id>
<content type='text'>
With MD5Sum checking being added, a concern was brought up that It was
a change with no possibility of reverting to the old behaviour.
This change adds the flag '--ignore-checksum' to the upload subcommand
allowing the checks to be turned off.

Changed occurrences of the magic string for a null md5 to use a descriptive
constant instead.

Updated Error messages generated when validation fails. They should now be more descriptive
and not output a literal newline sequence.

Change-Id: Id1756cbb6700bb7e38f0ee0e75bc535e37f777ed
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With MD5Sum checking being added, a concern was brought up that It was
a change with no possibility of reverting to the old behaviour.
This change adds the flag '--ignore-checksum' to the upload subcommand
allowing the checks to be turned off.

Changed occurrences of the magic string for a null md5 to use a descriptive
constant instead.

Updated Error messages generated when validation fails. They should now be more descriptive
and not output a literal newline sequence.

Change-Id: Id1756cbb6700bb7e38f0ee0e75bc535e37f777ed
</pre>
</div>
</content>
</entry>
</feed>
