846 Commits

Author SHA1 Message Date
Zuul
a08d9b109f Merge "Add a query_string option to head_object()." 2018-03-06 22:15:11 +00:00
Timur Alperovich
a36c3cfda1 Add a query_string option to head_object().
Submitting a path parameter with a HEAD request on an object can be
useful if one is trying to find out information about an SLO/DLO without
retrieving the manifest.

Change-Id: I39efd098e72bd31de271ac51d4d75381929c9638
2018-03-05 17:33:22 -08:00
wangqi
cec0f0e4ed Update links in README
Change the outdated links to the latest links in README

Change-Id: Ic0adc686592265f2be2acb55f0520c35d1717f76
2018-03-05 13:23:54 +00:00
Zuul
73f0259dbc Merge "Update the old http doc links" 2018-01-31 00:36:47 +00:00
shangxiaobj
8bf86accca Update the old http doc links
Update the old http doc links to the https ones according to the
official OpenStack website.

Change-Id: Ibf9ecbccb743d2b9a678a1ca69f0b3adc9106a12
2018-01-30 00:28:17 +00:00
65bfbb00bf Update reno for stable/queens
Change-Id: I7f7b21e3dd0d1ef71c159e2b72f9ad9f963b0773
2018-01-29 09:21:32 -08:00
John Dickinson
b91651eba0 authors/changelog updates for 3.5.0 release
Change-Id: I70b79c0fd6e9adbfdcc799459dc52063c7402be2
2018-01-24 08:36:58 +11:00
Timur Alperovich
2faea93287 Allow for object uploads > 5GB from stdin.
When uploading from standard input, swiftclient should turn the upload
into an SLO in the case of large objects. This patch picks the
threshold as 10MB (and uses that as the default segment size). The
consumers can also supply the --segment-size option to alter that
threshold and the SLO segment size. The patch does buffer one segment
in memory (which is why 10MB default was chosen).

(test is updated)

Change-Id: Ib13e0b687bc85930c29fe9f151cf96bc53b2e594
2018-01-18 04:56:12 +00:00
Tim Burke
a9b8f0a0d1 Revert "Add Constraints support"
Per http://lists.openstack.org/pipermail/openstack-dev/2017-December/125348.html

> For many projects, tox_install.sh is not needed at all

Let's see if that holds for python-swiftclient!

This reverts commit f2f278fcbec3ad52a1726bb5a3f775d13bcc99dc.

Change-Id: I0462c50ec71d87bac226f83a0d0942871ef5a0e7
2018-01-17 11:13:59 -08:00
Zuul
cde257de5c Merge "Allow --meta on upload" 2017-12-08 19:51:05 +00:00
Tim Burke
cb2778659e Make tox runnable in a directory with spaces
I noticed a disturbing lack of quote-wrapping in change
I7cb4b44952713752435e1faf0f63bf0d37e7dda6 but as I poked at it, I
realized that trouble runs rampant.

This seems to clean it all up, though I haven't tested *every*
environment we define.

Change-Id: I1454eb113e5bd9125d39f2e57e2ed96f6ddc42fc
2017-11-28 11:02:45 -08:00
Zuul
2b3a659da4 Merge "Update tox_install.sh to align for sphinx jobs" 2017-11-28 13:05:48 +00:00
Monty Taylor
ae2dfaec36 Update tox_install.sh to align for sphinx jobs
The updates to the sphinx docs jobs in support of the updates to
the PTI wound up exposing an unintended interface. There are two flavors
of the tox_install.sh file out there, and we basically need to collapse
them into one flavor.

Update the tox_install.sh script to match the
constraints-as-first-argument form.

Change-Id: I7cb4b44952713752435e1faf0f63bf0d37e7dda6
2017-11-22 15:19:17 +00:00
Andreas Jaeger
f48f421a86 Remove setting of version/release from releasenotes
Release notes are version independent, so remove version/release
values. We've found that projects now require the service package
to be installed in order to build release notes, and this is entirely
due to the current convention of pulling in the version information.

Release notes should not need installation in order to build, so this
unnecessary version setting needs to be removed.

This is needed for new release notes publishing, see
I56909152975f731a9d2c21b2825b972195e48ee8 and the discussion starting
at
http://lists.openstack.org/pipermail/openstack-dev/2017-November/124480.html
.

Change-Id: I623fe918c1e4ddafa93efc91ed550a365cec1cf0
2017-11-16 20:50:07 +01:00
Tim Burke
3be8eca70b Add pypy-devel for RPM-based systems
Also, don't try to do any pypy stuff on Fedora -- apparently that's only
available from the Everything repo instead of the stripped-down Server
one the gate images use? I only wanted Fedora for py36 testing, anyway.

Change-Id: Iba8142e4e1093cf7f7a9dcf782288364d43cb64d
2017-08-29 09:50:18 -07:00
Jenkins
c50823ebf1 Merge "Add support for versionless endpoints" 2017-08-29 02:15:28 +00:00
Tim Burke
f323bb4824 Trying out the new releasenotes jobs
Change-Id: I96a29ab48cd7a349d0eb17efce7df097d4174cbe
Depends-On: I5820bb2ffa0e3c65ac846ced97435b7c3086aefc
2017-08-08 22:40:10 +00:00
Tim Burke
ed0858a4e4 Add releasenotes tox env
After this, we need to

* add release notes jobs for python-swiftclient in openstack-infra/project-config
* add release notes links for python-swiftclient in openstack/releases

For the corresponding change in the swift repo, see
I4e5f1ce1fcfbb2943036c821a24a0b4a3a2d9fc8

Change-Id: Iea6ed2ee26873edb3ef10146cdc906cf1a236255
2017-08-08 22:03:59 +00:00
John Dickinson
e1945ea0fa 3.4.0 authors/changelog update
Change-Id: Ib6a7c97ff90f03a26fe7396c0104c5a0c483c226
2017-07-26 20:22:53 -07:00
Timur Alperovich
0982791db2 Allow for uploads from standard input.
If "-" is passed in for the source, python-swiftclient will upload
the object by reading the contents of the standard input. The object
name option must be set, as well, and this cannot be used in
conjunction with other files.

This approach stores the entire contents as one object. A follow on
patch will change this behavior to upload from standard input as SLO,
unless the segment size is larger than the content size.

Change-Id: I1a8be6377de06f702e0f336a5a593408ed49be02
2017-07-26 17:04:19 -07:00
John Dickinson
124c7de676 moved cli doc to the right place for new links process
Change-Id: I5d2f681ba5ce1f95d006eb7208cdb388a64811c9
2017-07-26 13:49:55 -07: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
Tim Burke
484d7ee9b2 Allow --meta on upload
Previously, the --meta option was only allowed on post or copy subcommands.

Change-Id: I87bf0338c34b5e89aa946505bee68dbeb37d784c
Closes-Bug: #1616238
2017-07-06 12:43:11 -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
Christian Schwede
2ff3102cf7 Add support for versionless endpoints
Newer deployments are using versionless Keystone endpoints, and most
OpenStack clients already support this.

This patch enables this for Swift: if an auth_url without any path
component is found, it assumes a versionless endpoint will be used.
In this case the v3 suffix will be appended to the path if none
auth_version is set, and v2.0 is appended if auth_version requires v2.

Closes-Bug: 1554885
Related-Bug: 1691106
Change-Id: If7ecb67776cb77828f93ad8278cc5040015216b7
2017-06-13 10:55:50 +02: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