807 Commits

Author SHA1 Message Date
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
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
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
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
ocata-em
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
Jenkins
41de8b7c0b Merge "Enable code coverage report in console output" 2016-11-04 22:51:17 +00:00
Matthew Oliver
5296daad83 Correct the example keystone session code imports
This is a follow up to patch Ia3fd947ff619c11ff0ce474897533dcf7b49d9b3.
One of the imports for the keystone session example was wrong. It was
trying to import v3 like:

  from keystoneauth1 import v3

Whereas in my testing v3 actually exists deeper under identity:

  from keystoneauth1.identity import v3

This patch fixes this import in the example documentation.

Change-Id: Ie31144fe65116d20a36b83a96079a3804bf55f29
2016-10-29 11:43:02 +02:00
Tim Burke
481f74caf1 Low-level API: Don't log just before raising an exception
The only logging we should do is when we've encountered a problem *and
we've dealt with it ourselves*. When we're raising an exception, it
should be up to the caller to decide whether to log anything about it.

Anything else is just rude.

Change-Id: I1c96b76d90a78b7a10ffe63e4a7440c8f579147c
Closes-Bug:  1213179
Related-Bug: 1202229
2016-10-28 17:37:37 +02:00
Jenkins
e9887703d0 Merge "Adding keystoneauth sessions support" 2016-10-26 11:41:21 +00:00
Tim Burke
a38efb6031 Add v1password keystoneauth plugin
This lets us use Keystone sessions against endpoints like swauth and
tempauth with code like:

    import keystoneauth1.loading
    import keystoneauth1.session
    import swiftclient

    loader = keystoneauth1.loading.get_plugin_loader('v1password')
    auth_plugin = loader.load_from_options(
        auth_url='http://saio:8080/auth/v1.0',
        username='test:tester',
        password='testing')
    keystone_session = keystoneauth1.session.Session(auth_plugin)

    conn = swiftclient.Connection(session=keystone_session)

The plugin includes an optional project_name option, which may be used
to override the swift account from the storage url that was returned.
Additionally, it includes enough infrastructure to support some commands
in python-openstackclient>=3.0:

    export OS_AUTH_TYPE=v1password
    export OS_AUTH_URL=http://saio:8080/auth/v1.0
    export OS_PROJECT_NAME=AUTH_test2
    export OS_USERNAME=test:tester
    export OS_PASSWORD=testing

    openstack token issue
    openstack catalog list
    openstack catalog show object-store
    openstack object store account show
    openstack container list
    openstack container create <container>
    openstack container save <container>
    openstack container show <container>
    openstack container delete <container>
    openstack object list <container>
    openstack object create <container> <file>
    openstack object save <container> <object>
    opsentack object show <container> <object>
    openstack object delete <container> <object>

Change-Id: Ia963dc44415f72a6518227e86d9528a987e07491
2016-10-24 01:52:37 +02:00
zheng yin
4d040eecd9 Add commands examples for copy and delete
There are no examples for copy and delete command. For beginners,
they may not use both commands. Therefore, I add examples, then
beginners are able to understand how to use both commands.

Change-Id: Id702dc3f9ab903c1c1183c1e229dc6ebedaac0a7
2016-10-20 19:32:01 +08:00
Jenkins
a0d1fe04bc Merge "add pypy to the bindep "test" profile" 2016-10-20 00:29:49 +00:00
shashi.kant
432df97c3a Enable code coverage report in console output
Modified swift-client tox.ini configuration to enable code coverage
report in console output.

Change-Id: I60276d6a87c62f4a112b01d97ab35a545d4e5462
2016-10-19 17:57:51 +05:30
Jenkins
d007ef7b2d Merge "Use ConfigParser instead of SafeConfigParser" 2016-10-17 10:48:56 +00:00
Pallavi
b6cf56deb9 Use ConfigParser instead of SafeConfigParser
The SafeConfigParser class has been renamed to ConfigParser in Python
3.2. This alias will be removed in future versions.So we can use
ConfigParser directly instead.

Change-Id: Ie0292271229ee77d1bc57dd897ebbbb3d3c059aa
Closes-Bug: #1618666
2016-10-17 08:56:44 +00:00
Anh Tran
a71c0d5a30 Replace assertTrue(a in b) with assertIn(a, b)
Change-Id: I9726c9c051eea9264200ab27b3e556c68d5c927f
2016-10-03 09:35:59 +07:00
Jenkins
30e0bf5a49 Merge "Require newer version of oslosphinx" 2016-09-29 22:25:50 +00:00
Jenkins
d8e50378ef Merge "Installs futures only for python 2.7 and 2.6" 2016-09-29 18:11:27 +00:00
Yushiro FURUKAWA
9be94f3bae Fix 'url' to 'URL'
TrivialFix

Change-Id: I6f35b0c48eda7d6021c2f6a13c084170ebf552d2
2016-09-29 20:25:55 +09:00
Anh Tran
bb3160a42c Remove redundant space in docstring
TrivialFix

Change-Id: I7012fb7bbbedfba30b8e0450a449787e9076f4ef
2016-09-28 11:25:56 +07:00
Claudiu Belu
b3921b26e8 Installs futures only for python 2.7 and 2.6
The futures library is native to python 3 and it doesn't
have to be installed from pypi.

If the futures library is installed, it can cause issues when used.

Changes the futures' library requirement to match the one in
global requirements. [1]

[1] https://github.com/openstack/requirements/blob/master/global-requirements.txt

Change-Id: I8f13d63a303b71f7bdd8c3e67c15d0a0df5ea7a9
Closes-Bug: #1628107
2016-09-27 16:28:11 +00:00
Anh Tran
ab7a8b2453 TrivialFix: Removed redundant 'the'
Change-Id: I3b3c0e7e4d5c8a1934378e2083a64bb686754f18
2016-09-27 16:10:14 +07:00