Commit Graph

824 Commits

Author SHA1 Message Date
Tony Breeds 61c3872483 Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).

Change-Id: I521e44397eaf2841c255de75600895c3f6ec6f7b
2017-09-12 16:11:54 -06:00
Hangdong Zhang 3db6ddd6e4 Update the documentation link for doc migration
Change-Id: I1a5a354675b3ca6a7dbb5ab2dc78bf60209fa2b5
2017-07-24 09:49:59 -07:00
John Dickinson 487b5a1ce4 merged openstack-manuals content with existing content
Change-Id: I05bc8f80daefbb32f32727550a9cbe43e9754e2f
2017-07-21 11:09:15 -07:00
Tim Burke 638d7c789c Buffer reads from disk
Otherwise, Python defaults to 8k reads which seems kinda terrible.

Change-Id: I3160626e947083af487fd1c3cb0aa6a62646527b
Closes-Bug: #1671621
2017-07-11 17:04:49 -07:00
Christopher Bartz cde73c196d Option to ignore mtime metadata entry.
Currently, the swiftclient upload command passes a custom metadata
header for each object (called object-meta-mtime), whose value is
the current UNIX timestamp. When downloading such an object with the
swiftclient, the mtime header is parsed and passed as the atime and
mtime for the newly created file.

There are use-cases where this is not desired, for example when using
tmp or scratch directories in which files older than a specific date
are deleted. This commit provides a boolean option for ignoring the
mtime header.

Change-Id: If60b389aa910c6f1969b999b5d3b6d0940375686
2017-07-06 10:19:12 -07:00
Jenkins 1d57403668 Merge "Skip checksum validation on partial downloads" 2017-06-22 01:13:26 +00:00
Jenkins bc3171cfac Merge "Tolerate RFC-compliant ETags" 2017-06-22 01:13:04 +00:00
Jenkins 4515002d78 Merge "Stop sending X-Static-Large-Object headers" 2017-06-14 23:35:32 +00:00
Jenkins 74eb91b176 Merge "Do not set Content-Type to '' with new requests." 2017-06-13 22:07:47 +00:00
Timur Alperovich 32f6b3c642 Do not set Content-Type to '' with new requests.
Previously, python-swiftclient worked around a requests issue where
Content-Type could be set to application/x-www-form-urlencoded when
using python3. This issue has been resolved and a fix released in
requests 2.4 (fixed in subsequent releases as well). The patch makes
the workaround conditional on the requests version, so that with
sufficiently new requests libraries, the Content-Type is not set.

For reference, requests 2.4 was released August 29th, 2014. The
specific issue filed in the requests tracker is:
https://github.com/requests/requests/issues/2071.

Related-Change: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
Closes-Bug: #1433767

Change-Id: Ieb2243d2ff5326920a27ce8c3c6f0f5c396701ed
2017-06-13 10:41:01 -07:00
Jenkins f18d070b0b Merge "Fix MockHttpResponse to be more like the Real" 2017-06-12 19:25:45 +00:00
Jenkins 6d5e87a183 Merge "ISO 8601 timestamps for tempurl" 2017-05-18 14:37:17 +00:00
Tim Burke 527f2ff687 Skip checksum validation on partial downloads
If we get back some partial content, we can't validate the MD5.
That's OK.

Change-Id: Ic1d65272190af0d3d982f3cd06833cac5c791a1e
Closes-Bug: 1642021
2017-04-21 10:30:01 -07:00
Tim Burke 64da481ccd Tolerate RFC-compliant ETags
Since time immemorial, Swift has returned unquoted ETags for plain-old
Swift objects -- I hear tell that we once tried to change this, but
quickly backed it out when some clients broke.

However, some proxies (such as nginx) apparently may force the ETag to
adhere to the RFC, which states [1]:

    An entity-tag consists of an opaque *quoted* string

(emphasis mine). See the related bug for an instance of this happening.

Since we can still get the original ETag easily, we should tolerate the
more-compliant format.

[1] https://tools.ietf.org/html/rfc2616.html#section-3.11 or, if you
    prefer the new ones, https://tools.ietf.org/html/rfc7232#section-2.3

Change-Id: I7cfacab3f250a9443af4b67111ef8088d37d9171
Closes-Bug: 1681529
Related-Bug: 1678976
2017-04-21 10:28:33 -07:00
John Dickinson 0cc4d8af18 respect bulk delete page size and fix logic error
Previously, using SwiftService to delete "many" objects would use
bulk delete if available, but it would not respect the bulk delete
page size. If the number of objects to delete exceeded the bulk delete
page size, SwiftService would ignore the error and nothing would be
deleted.

This patch changes _should_bulk_delete() to be _bulk_delete_page_size();
instead of returning a simple True/False, it returns the page size for
the bulk deleter, or 1 if objects should be deleted one at a time.
Delete SDK calls are then spread across multiple bulk DELETEs if the
requested number of objects to delete exceeds the returned page size.

Fixed the logic in _should_bulk_delete() so that if the object list
is exactly 2x the thread count, it will not bulk delete. This is the
natural conclusion following the logic that existed previously: if
the delete request can be satisfied by every worker thread doing one
or two tasks, don't bulk delete. But if it requires a worker thread
to do three or more tasks, do a bulk delete instead. Previously, the
logic would mean that if every worker thread did exactly two tasks, it
would bulk delete. This patch changes a "<" to a "<=".

Closes-Bug: 1679851
Change-Id: I3c18f89bac1170dc62187114ef06dbe721afcc2e
2017-04-20 09:41:53 -07:00
Tim Burke aaaed55cd4 Stop sending X-Static-Large-Object headers
If we were to include this in a normal PUT, it would 400, but only if
slo is actually in the pipeline. If it's *not*, we'll create a normal
Swift object and the header sticks.

- This is really confusing for users; see the related bug.
- If slo is later enabled in the cluster, Swift starts responding 500
  with a KeyError because the client and on-disk formats don't match!

Change-Id: I1d80c76af02f2ca847123349224ddc36d2a6996b
Related-Change: I986c1656658f874172860469624118cc63bff9bc
Related-Bug: #1680083
2017-04-10 15:40:35 -07:00
M V P Nitesh 058fb0323f Optimize the link address
Use https instead of http to ensure the safety

Change-Id: I1e072bd3288f2de530ac22a4e99899f18f1ceaf3
2017-04-10 16:00:39 +05:30
Christopher Bartz 8e08931b9f ISO 8601 timestamps for tempurl
Client-side implementation for ISO 8601 timestamp
support of tempurl middleware. Please see

https://review.openstack.org/#/c/422679/

Change-Id: I76da28b48948475ec1bae5258e0b39a316553fb7
2017-03-29 14:27:39 -04:00
liuyamin 2710ff255b Fix some reST field lists in docstrings
Probably the most common format for documenting arguments is
reST field lists [1]. This change updates some docstrings to
comply with the field lists syntax.

[1] http://sphinx-doc.org/domains.html#info-field-lists

Change-Id: Ic011fd3e3a8c5bafa24a3438a6ed5bb126b50e95
2017-03-29 09:28:46 +08:00
Nelson Marcos b404df9aba Removing duplicated doc from client-api
Change-Id: I1a9ef0c33c68a32808686194c74c27d66d2617e0
2017-03-27 16:23:16 -03:00
Jenkins 94db1f2551 Merge "[trivial] Be consistent in using example.com" 2017-03-22 17:46:16 +00:00
Jenkins cf214393af Merge "Close file handle after upload job" 2017-03-20 03:07:52 +00:00
Jenkins 8aae889f26 Merge "Don't recommend to overwrite imported `session` variable" 2017-03-17 18:55:39 +00:00
Kota Tsuyuzaki e684913489 Don't recommend to overwrite imported `session` variable
Change-Id: I34e25e674aac3a85a4702779053d95962b292281
2017-03-16 22:26:29 -07:00
Kazufumi Noto 809e4cf98f Close file handle after upload job
The opened file for upload is not closed.
This fix prevents possible file handle leak.

Closes-Bug: #1559079
Change-Id: Ibc58667789e8f54c74ae2bbd32717a45f7b30550
2017-03-16 18:03:13 +00:00
Petr Kovar 24dda6af9f [trivial] Be consistent in using example.com
* Use distro-agnostic example.com in all examples.

Change-Id: If0a7217b7312875bb4ca8258f4ef86c52cd2e577
2017-03-13 16:26:28 +01:00
Clay Gerrard dd34af42f8 Fix MockHttpResponse to be more like the Real
This change pulls out that relatively new [1] little string to pull at
in the MockHttpResponse that I think is sorta ugly.  And replaces it
with the correct behavior that's representative of the Real for which
it's standing in (which is sadly our wrapper to make a requests response
feel like a httplib.HTTPResponse).

It's not clear (to me) the history which allowed this difference in the
behavior of the Real and Fake to persist - it seems to have always been
this way [2].

I also reworded a relatively new test [1] to cover more code, and make
assertions on the desired behavior of the client instead of "just" the
http_log method.

FWIW, I don't think there was necessarily anything wrong with the scope
of the new test [1] - and it certainly makes sense to see new tests copy
nearby existing tests.  But I subjectively think this smaller test is
more demonstrative of the desired behavior.

1. Related-Change-Id: I6d7ccbf4ef9b46e890ecec58842c5cdd2804c7a9
2. Related-Change-Id: If07af46cb377f3f3d70f6c4284037241d360a8b7
Change-Id: Ib99a029c1bd1ea1efa8060fe8a11cb01deea41c6
2017-03-08 10:51:43 -08:00
Andreas Jaeger ee8620de94 Change swift.o.o URL
This is an obsolete URL that redirects, use docs.o.o - and use https for
it.

Change-Id: I7ba2c49db2c620071f8eeb96d0b63af8381ed899
2017-03-08 16:53:24 +01:00
Vitaly Gridnev 028c4824d0 Fix logging of the gzipped body
Change-Id: I6d7ccbf4ef9b46e890ecec58842c5cdd2804c7a9
Closes-bug: 1670620
2017-03-08 00:50:55 +04:00
Joel Wright 91de5e8a38 Expose --prefix as an option for st_delete
The SwiftService and shell support the ability to limit
deletions to only those objects that match a specified
prefix, so let's expose that (really useful) behaviour
in the command line help as well :)

Change-Id: I9ef177aa96e4829196b5200dd8e9d0d2f7f89b63
2017-02-23 11:09:14 +00:00
John Dickinson 307d4c007a 3.3.0 authors/changelog update
Change-Id: Idc92915d5b23019bc0d65d17b1f5104b3dca57ee
2017-01-25 15:12:59 -08:00
Jenkins 9531369c23 Merge "Make functests py3-compatible" 2017-01-24 01:28:27 +00:00
Jenkins 5ffd496f1f Merge "Accept more types of input for headers/meta" 2017-01-24 00:39:54 +00:00
Jenkins 816565d575 Merge "Add Constraints support" 2017-01-24 00:39:40 +00:00
Christopher Bartz 3934bd606a prefix-based tempurls support
Implements client-side functionality for
prefix-based tempurls.

Please see: https://review.openstack.org/#/c/274048/

Change-Id: I8d7701daee888ed1120271a96c0660b01543ca2d
2017-01-19 16:34:26 +01:00
Tony Breeds f2f278fcbe Add Constraints support
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.

This change adds constraints support by also adding a helper script to
edit the constraints to remove python-swiftclient.

Change-Id: I3947a6165eaa9f5cb62a7df4f5a2c16065da2f1d
2016-12-27 15:47:18 -08:00
zhangyanxian aea0585ddb Fix typo in shell.py
TrivialFix

Change-Id: I0b0a21df1433ec8f355c452c91a818feb9f6f134
2016-12-16 22:32:17 +00:00
wangxiyuan ae57155d39 Typo fix
Change "novaclient" to "swiftclient"

Change-Id: I685b476cb05c223959c977b135a8217fb961afb1
2016-12-15 16:24:30 +08:00
Jenkins 524eb54320 Merge "Add commands examples for copy and delete" 2016-12-15 03:31:50 +00:00
Jenkins 39a0eda486 Merge "modify 'swift <sub_command> —help' display" 2016-12-13 23:00:01 +00:00
Shashirekha Gundur 41666d60c8 modify 'swift <sub_command> —help' display
In python swiftclient:  swift <sub_command> —help will now
display st_<sub_command>_options + st_<sub_command>_help texts
e.g. http://paste.openstack.org/show/589752/

Change-Id: I34e4b2ac29ef395f8ca474ce7a82f59a1fd8c7f4
Closes-Bug: #1621415
2016-12-13 13:41:08 +00:00
Jenkins e3d6c34c98 Merge "Show team and repo badges on README" 2016-12-01 01:56:40 +00:00
Jenkins 0d09919ee3 Merge "Fix 'url' to 'URL'" 2016-12-01 01:38:19 +00:00
Flavio Percoco 03acc41c58 Show team and repo badges on README
This patch adds the team's and repository's badges to the README file.
The motivation behind this is to communicate the project status and
features at first glance.

For more information about this effort, please read this email thread:

http://lists.openstack.org/pipermail/openstack-dev/2016-October/105562.html

To see an example of how this would look like check:

https://gist.github.com/7d9f14fa125fa35b52bc840eb94828b2

Change-Id: I5f6a3351469516aa81d5eb0fe7c842fe35d1433a
2016-11-25 16:35:52 +01:00
Tim Burke a1e2bcde4a Accept more types of input for headers/meta
Previously, we only accepted iterables of strings like 'Header: Value'.
Now, we'll also accept lists of tuples like ('Header', 'Value') as well
as dictionaries like {'Header': 'Value'}.

This should be more intuitive for application developers, who are
already used to being able to pass dicts or lists of tuples to libraries
like requests.

Change-Id: I93ed2f1e8305f0168b7a4bd90c205b04730da836
2016-11-18 11:47:14 -08:00
howardlee 12d42efad2 Replace 'assertEqual(None, ...)' with 'assertIsNone(...)'
[H203] Use assertIs(Not)None to check for None (off by default) Unit
test assertions tend to give better messages for more specific
assertions. As a result, assertIsNone(...) is preferred over
assertEqual(None, ...) and assertIs(None, ...), and assertIsNotNone(...)
is preferred over assertNotEqual(None, ...) and assertIsNot(None,
...). Off by default.

More details, see:
http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises

Trivial fix.

Change-Id: Icd268b96dea5e5bb9bd344f597dfcd9cc82253f0
2016-11-18 15:26:14 +08:00
John Dickinson 5a620f83e8 3.2.0 release notes
I have also reordered the AUTHORS file to be ordered by
the first character of the author's name.

Change-Id: I529988c809a2748bd6ce212a2216e692fbefe3ba
2016-11-09 11:25:15 -08:00
Jenkins 70c90b2243 Merge "Add additional headers for HEAD/GET/DELETE requests." 2016-11-08 19:30:40 +00:00
Jenkins cb922f4dc6 Merge "Add v1password keystoneauth plugin" 2016-11-08 18:35:50 +00:00
Charles Hsu 6cf2bd6626 Add additional headers for HEAD/GET/DELETE requests.
Change-Id: I69276ba711057c122f97deac412e492e313c34dd
Closes-Bug: 1615830
2016-11-07 13:18:29 +08:00