730 Commits

Author SHA1 Message Date
Tim Burke
7cd7df410a Change Examples from headings to topics
Previously, they appeared in the table of contents, which seemed unnecessary.

Additionally, de-dent the bullet list for stat since it looked weird.

Change-Id: Ief5d480beb4a7daa2fd87c27019601332f087602
2016-08-26 13:50:31 -07:00
Jenkins
20e0c515bf Merge "client: renew token on 401 even if retries is 0" 2016-08-26 17:37:41 +00:00
Jenkins
19cd127294 Merge "boolean logic cleanup in service.Swift[Copy|Post]Object" 2016-08-25 22:47:41 +00:00
Jenkins
9cdeedab7d Merge "Use mock patch to handle get_auth_keystone" 2016-08-25 22:26:54 +00:00
Jenkins
a2371cc6d8 Merge "Fix examples and missing code-block" 2016-08-25 20:29:54 +00:00
Clay Gerrard
96f0031e64 boolean logic cleanup in service.Swift[Copy|Post]Object
Change-Id: I07e74536502ec2479b22a825f684703d65924563
2016-08-25 13:15:44 -07:00
Joel Wright
daed43a44a Fix examples and missing code-block
This patch fixes a missing code-block section in the
capabilities section of service-api.rst, and fixes
the import of walk in the upload.py examples to support
both python2 and python3.

Change-Id: I572769f971f84e0029f2948e42c130e73517f434
2016-08-25 11:27:49 +00:00
Jamie Lennox
fd675b2c5a Use mock patch to handle get_auth_keystone
Setting c.get_auth_keystone = fake_get_auth_keystone is setting a new
method on the module. This information is not reset between test runs
and therefore has the potential to corrupt other tests.

Use mock patch so that the mock is reset after the test is complete.

Change-Id: Ifb9ba72634cf477c72dda080b5aed8f8e3a7ac89
2016-08-25 17:18:20 +10:00
Jenkins
5acefd27e4 Merge "Strip leading/trailing whitespace from headers" 2016-08-25 04:24:16 +00:00
Jenkins
b57044a853 Merge "Add copy object method" 2016-08-24 23:59:34 +00:00
Marek Kaleta
4a2465fb12 Add copy object method
Implement copy object method in swiftclient Connection, Service and CLI.

Although COPY functionality can be accomplished with 'X-Copy-From'
header in PUT request, using copy is more convenient especially when
using copy for updating object metadata non-destructively.

Closes-Bug: 1474939
Change-Id: I1338ac411f418f4adb3d06753d044a484a7f32a4
2016-08-23 14:37:11 -07:00
Tim Burke
8fbe118cea Strip leading/trailing whitespace from headers
New versions of requests will raise an InvalidHeader error otherwise.

Change-Id: Idf3bcd8ac359bdda9a847bf99a78988943374134
Closes-Bug: #1614280
Closes-Bug: #1613814
2016-08-19 19:53:11 +00:00
Andreas Jaeger
b1539d9c0f Move other-requirements.txt to bindep.txt
The default filename for documenting binary dependencies has been
changed from "other-requirements.txt" to "bindep.txt" with the release
of bindep 2.1.0. While the previous name is still supported, it will
be deprecated.

Move the file around to follow this change.

Note that this change is self-testing, the OpenStack CI infrastructure
will use a "bindep.txt" file to setup nodes for testing.

For more information about bindep, see also:
http://docs.openstack.org/infra/manual/drivers.html#package-requirements
http://docs.openstack.org/infra/bindep/

As well as this announcement:
http://lists.openstack.org/pipermail/openstack-dev/2016-August/101590.html

Change-Id: I384cdb39c1f65218bb5c6f76afc381c1799b623e
2016-08-12 21:14:25 +02:00
John Dickinson
ed4ee79273 reenable sidebar links
uses new method from https://review.openstack.org/#/c/340509/

Change-Id: I4d19b71b632546fc2e5d5dac2b0d8d43152dabed
2016-08-11 15:15:06 -07:00
Jenkins
2766744ba1 Merge "Fix unicode issues in tempurl command" 2016-08-07 23:43:13 +00:00
Jenkins
92178ac17c Merge "Add --json option to swift capabilities / swift info" 2016-08-06 00:10:32 +00:00
Tim Burke
335570e511 Add --json option to swift capabilities / swift info
This lets us do things like:

    $ swift info --json | jq '[.swift.policies[].name]'
    [
      "Standard-Replica",
      "EC"
    ]

Also, escape more dashes in the man page, so they won't be
misinterpreted as hyphens.

Change-Id: Ic7690bdbcfc55f55e5dde9bc11bb0644085973ce
2016-08-02 16:18:44 -07:00
zheng yin
d460db84ed Modify assert
For example: self.assertEqual(a,None) is equal to self.assertIsNone(a)

Change-Id: I063145d034979cf3d36645a00a30cc27defac7c4
2016-07-26 22:23:43 +08:00
Tim Burke
dca4ea5fd6 Fix unicode issues in tempurl command
Previously, we weren't encoding paths and keys as UTF-8, which would
trigger a UnicodeEncodeError on py27.

Change-Id: I2fad428369406c2ae32343a5e943ffb2cd1ca6ef
2016-07-19 12:52:51 -07:00
Jenkins
20ec344699 Merge "Add other-requirements.txt" 2016-07-13 17:44:45 +00:00
Shashirekha Gundur
5be9b7e310 fixing nit picks in python-swiftclient doc
Change-Id: Ifde19be175ea828a3137951a0382492434727b5b
2016-07-07 22:15:45 +00:00
Jenkins
0746b9b166 Merge "Add python version constraint python>=2.7" 2016-07-07 17:12:59 +00:00
Tim Burke
b9403105af Add other-requirements.txt
Change-Id: I6f273d41fc32bcb86f1b272d0a9000dbdaf5ce66
2016-07-05 21:59:19 -07:00
Cheng Li
13494098e2 Add python version constraint python>=2.7
The 'swift' command from v3.0.0 does not work in Python 2.6,
bacause some code is incompatible with Python 2.6
This patch is to add a constraint of python version

Change-Id: I5197cba0c2cd3135d08498df827a52f8bba98d4d
Closes-bug: #1590334
2016-07-06 02:16:52 +00:00
yuyafei
f4f2e6c261 Add __ne__ built-in function
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining
__eq__(), one should also define __ne__() so that the operators
will behave as expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

Change-Id: I5485022f010cdcb88c0d4ebe5c44a39a1bf242b0
2016-07-05 14:58:42 +08:00
Jenkins
07c960d46f Merge "Query string functionality for containers" 2016-06-14 19:36:45 +00:00
Andrew Welleck
439330cb9c Query string functionality for containers
Added functionality for arbitrary query strings to be passed into container
functions. Additionally a minor typo correction in the README. Added unit
tests for query string functionality.

Closes-Bug: #1542459
Change-Id: Ica2cb3ea439632588388e748d8d2e944e9ed4fa4
2016-06-09 13:51:26 -05:00
Julien Danjou
a62b7ee06c client: renew token on 401 even if retries is 0
Gnocchi uses a client with retries=0 to maximize throughtput and not retry N
times on e.g. 404 when checking existence of an object. However, this as the
side effect of never renewing the token since there' no retry on 401 either.

This patches change the behavior so that 401 errors are always retried,
whatever the retries value is.

Closes-Bug: #1589926
Change-Id: Ie06adf4cf17ea4592b5bbd7bbde9828e5e134e3e
2016-06-07 16:58:26 +02:00
Jenkins
c91c8d575e Merge "Add an option: disable etag check on downloads" 2016-06-06 10:33:25 +00:00
Jenkins
e1e2678cd0 Merge "Suppress InsecureRequestWarning when using --insecure" 2016-06-04 02:20:34 +00:00
Cheng Li
69bf4634b9 Add an option: disable etag check on downloads
This patch is to add an option of disable etag
check on downloads.

Change-Id: I9ad389dd691942dea6db470ca3f0543eb6e9703e
Closes-bug: #1581147
2016-06-02 22:53:18 +08:00
Tim Burke
ff505d72cd Suppress InsecureRequestWarning when using --insecure
The user already knows this is insecure, there's no point in bringing it
up again and again.

See also: https://github.com/kennethreitz/requests/issues/2214

Change-Id: I7991b2e568407269f84138bc03711147ed080c9c
2016-06-01 18:57:38 -07:00
Jenkins
e05464fbfa Merge "Fixed a typo in SwiftService API doc" 2016-06-01 20:06:10 +00:00
Jenkins
5981a69b01 Merge "Migrated contributing file from .md to .rst" 2016-06-01 18:50:31 +00:00
Nandini Tata
2e78ca5e75 Fixed a typo in SwiftService API doc
Fixed misspelled word in the Service API description.

Change-Id: I0bb6b2aa319ba217dd0d09a2c7a0d8eff9a67aff
2016-06-01 15:12:10 +00:00
Jenkins
f9d0657e70 Merge "Support client certificate/key" 2016-05-19 22:20:17 +00:00
Jenkins
8ffc5c11ae Merge "Use application/directory content-type for dir markers" 2016-05-19 08:53:50 +00:00
Jenkins
8da9cbf161 Merge "Correct doc string for http_conn argument" 2016-05-18 14:45:46 +00:00
venkatamahesh
659470e7d9 Update the home-page with developer documentation
Change-Id: I51734d7f8cabe02527c4f24305707dddf470d5f9
2016-05-17 14:32:47 +05:30
venkatamahesh
bf5846f9fd Migrated contributing file from .md to .rst
Change-Id: I80cbbced26906ac6ba9ae3faaba3a400e365be0d
2016-05-16 11:55:14 +00:00
Kota Tsuyuzaki
0225950c2a Correct doc string for http_conn argument
Previous doc string describes "http_conn" for a bunch of functions as
"HTTPConnection object" but it is actually "a tuple of (parsed_url,
HTTPConnection object)" so now this patch correct the mis-consistency.

Change-Id: I6ff90a941e6df6a1b3b5dc74fd5f4262654c9f0a
2016-05-12 21:39:14 -07:00
Jenkins
3a6c14981d Merge "Check responses when retrying bodies" 2016-05-11 07:52:47 +00:00
Jenkins
3faa99bac1 Merge "Tighten up testing for sloppy auth version" 2016-05-08 22:21:10 +00:00
Alistair Coles
a0d65e4ccd Tighten up testing for sloppy auth version
The existing test that os-identity-api-version=2 would
result in the correct auth_version=2.0 (note 2 -> 2.0)
does not verify the sloppy version handling code path.
When auth, key and user options are all missing the
auth version is always set to 2.0 so the test will always
pass. Adding auth, key and user options to the test command
will cause the test to verify that the os-identity-api-version
option was used and mapped to 2.0.

Change-Id: Ifa10cd2b8bf81c082d5e3fa846f993871194fea0
2016-05-05 15:25:16 +01:00
Tim Burke
fd5579a154 Check responses when retrying bodies
Previously, if a Range request came back 200 OK (rather than 206 Partial
Content), we would mangle the response body. This could happen if there
was a middleware that would silently drop Range headers, for example.

Now, if the response does not include a Content-Range header, we will
log a warning and seek to our previous position in the stream. If the
Content-Range header has an unexpected value, we will raise an exception.

Change-Id: I94d4536cc1489968d45a2b6ba7edd70c85800275
2016-05-04 15:21:26 -07:00
Tim Burke
67f629cdeb Default to v3 auth if we find a (user|project)-domain-(name|id) option
Change-Id: I4616492752b620de0bf90672142f1071ec9bac83
2016-05-03 14:41:07 -07:00
Tim Burke
c3766319b9 Pull option processing out to service.py
...because it seems silly that we do nearly the same thing in two
different places

Change-Id: Iafafe3c553d00652adb91ceefd0de1479cbcb5da
2016-05-03 14:18:34 -07:00
Tim Burke
5b714f104d Parse options to dict
This is a first step toward unifying the options parsing magic between
shell.py and service.py

Change-Id: If001e07978c0bae729ac0cd9b2c2934092c98447
2016-05-03 14:03:15 -07:00
Jenkins
c26dec66f6 Merge "Add tests for thread option validation" 2016-05-02 21:11:57 +00:00
Jenkins
6b065dd4a6 Merge "Identify segments uploaded via swiftclient" 2016-05-02 10:35:20 +00:00