510 Commits

Author SHA1 Message Date
Hiroshi Miura
be0f1aad8a change deprecated assertEquals to assertEqual
fix against H234: assertEquals() logs a DeprecationWarning
in Python3.x. use assertEqual() instead.

Closes-bug: #1480776

Change-Id: Iffda6bb5f2616d4af4567eeea37bb26531e34371
Signed-off-by: Hiroshi Miura <miurahr@nttdata.co.jp>
2015-08-06 18:50:33 +09:00
Hiroshi Miura
a056f1b374 fix old style class definition(H238)
Change-Id: Ib5be06fa544f5eb3061c6a3077a3b9986382ecfe
Signed-off-by: Hiroshi Miura <miurahr@nttdata.co.jp>
2015-08-04 11:34:51 +09:00
Jenkins
161e08df10 Merge "Block comment PEP8 fix." 2015-08-01 21:33:21 +00:00
Jenkins
9c640ae58d Merge "Test auth params together with --help option." 2015-07-31 17:33:17 +00:00
Jenkins
207e80c65c Merge "swiftclient: add short options to help message" 2015-07-31 04:54:13 +00:00
Ondrej Novy
847f135f97 Block comment PEP8 fix.
Change-Id: I999425902a5c82f7af129a8a1b6998d80edb225a
2015-07-30 09:55:51 +02:00
Ondrej Novy
1c644d8dc1 Test auth params together with --help option.
Change-Id: I2691739cc14bb8d384cc7ef0f8a3e73d1b898f88
2015-07-30 09:48:00 +02:00
Hiroshi Miura
7442f0dcc8 swiftclient: add short options to help message
- add usage strings for short option such as '-a' for '--all'
  This add all short options  to usage text.
- add missing --header usage help for download command
- some cometic changes

Closes-bug: #1475511

Change-Id: Ibfecac8764669540fa025787548133a50fa50b10
Signed-off-by: Hiroshi Miura <miurahr@nttdata.co.jp>
2015-07-17 16:03:39 +09:00
Jenkins
63998b481c Merge "Python 3: Replacing unicode with six.text_type for py3 compatibility" 2015-07-16 19:18:33 +00:00
Jenkins
a56eac13b1 Merge "Always decode command-line arguments as UTF-8" 2.5.0 2015-07-16 11:27:31 +00:00
Jenkins
c3b57f431c Merge "Properly test raw writes in Python 3" 2015-07-16 11:25:36 +00:00
Jenkins
dd45ae542b Merge "add tempurl command to swift.1 man page" 2015-07-13 23:47:35 +00:00
Zack M. Davis
ca70dd9e15 add tempurl command to swift.1 man page
Change-Id: Ifccc7f6dc049ca0ac2c53c00b1704cff4d1a770f
Closes-Bug: #1450606
2015-07-13 11:38:58 -07:00
Jenkins
de3fe02ba7 Merge "Correct the help message of swift tempurl" 2015-07-11 06:47:09 +00:00
Jenkins
605ec92507 Merge "Add some bash helpers for auth stuff" 2015-07-11 06:41:45 +00:00
Jenkins
0b592caabf Merge "Add ability to download objects to particular folder." 2015-07-11 06:21:40 +00:00
Tim Burke
87c0a83988 Update mock requirements
The last version supporting python 2.6 was 1.0.1.

Change-Id: Ib7d51157f9654d240cdd67a0a1e6fcb14a70c84a
2015-07-10 13:56:48 -07:00
Charles Hsu
d5d3127744 Add ability to download objects to particular folder.
This patch adds "--output-dir" and "--remove-prefix" options
to the "download" command and unit tests for it.

Example:

    $ swift list example --prefix swift2.2
    swift2.2/bin/swift-object-auditor
    swift2.2/bin/swift-object-expirer
    swift2.2/bin/swift-object-info
    swift2.2/bin/swift-object-replicator
    swift2.2/bin/swift-object-server
    swift2.2/bin/swift-object-updater

When given "--output-dir <directory>", client downloads objects to <directory>.

    $ swift download example --prefix swift2.2 \
                    --output-dir new/swift/dir

    The folder structure:
    .
    └── new
        └── swift
            └── dir
                └── swift2.2
                    └── bin
                        ├── swift-object-auditor
                        ├── swift-object-expirer
                        ├── swift-object-info
                        ├── swift-object-replicator
                        ├── swift-object-server
                        └── swift-object-updater

When given "--remove-prefix", client downloads objects without <prefix>.

    $ swift download example --prefix swift2.2 \
                    --remove-prefix \
                    --output-dir swift

    The folder structure:
    .
    └── swift
        └── bin
            ├── swift-object-auditor
            ├── swift-object-expirer
            ├── swift-object-info
            ├── swift-object-replicator
            ├── swift-object-server
            └── swift-object-updater

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Change-Id: I7463fe2941cc94f9a50a4756a97c2ccdf946294d
Implements: blueprint swiftclient-download-pseudo-folder-to-specific-target
2015-07-08 14:23:05 +08:00
Tim Burke
bb252130ac Always decode command-line arguments as UTF-8
There was always an implicit assumption that they were UTF-8 before, and
by converting them to unicode we close another hole allowing raw bytes
to appear in user-facing messages.

Closes-Bug: #1431866
Change-Id: If2e41d9a592c3ad02818e9c6f0959fd4b73cd0e0
2015-07-07 15:39:55 -07:00
Tim Burke
cf0b6c03df Properly test raw writes in Python 3
Previously we were trying to test writing bytes in Python 3 using only
native (unicode) string objects. That doesn't test what we thought we
were testing.

Change-Id: I10a0a38143d7f7d850ab9a7005ad87f5d314c375
2015-07-07 15:39:02 -07:00
Jenkins
92b8277752 Merge "SwiftClient object upload beginning with / or "./"" 2015-07-07 22:21:38 +00:00
Jenkins
249dd1a393 Merge "Added check for negative segment-size" 2015-07-07 01:36:50 +00:00
Jenkins
2a62dd88ff Merge "Document missing functional test config option" 2015-07-02 02:39:43 +00:00
Jenkins
795476e013 Merge "Run functional tests using keystone auth options" 2015-07-02 00:14:41 +00:00
Jenkins
f5fa154f6d Merge "Add passenv to tox.ini to make functests run with tempauth" 2015-07-02 00:14:38 +00:00
Jenkins
29e5c5656e Merge "Add connection release test" 2015-07-02 00:04:52 +00:00
Jenkins
0df888ea55 Merge "Remove all DLO segments on upload of replacement" 2015-07-02 00:04:50 +00:00
Tim Burke
70afe207cf Bump hacking in test-requirements
The gate-swiftclient-dsvm-functional job takes updates from
openstack/requirements and tries to run functional tests against them.
However, the global requirements recently added environment markers
(like "futures>=3.0;python_version=='2.7' or python_version=='2.6'")
which require pbr>=1.2. pbr was getting capped at 1.0 by hacking<0.9, so
bump it to get newer pbr.

Change-Id: I10af36602d23db78c2863d84c0012835b310bbdd
2015-07-01 11:11:53 -07:00
YangLei
91855bd912 Correct the help message of swift tempurl
correct the help message of swift tempurl
use <> instead of [] in Positional arguments.

Change-Id: Ib60ce97cef03e0423082c497604525eba2300fa9
2015-06-30 15:10:44 +08:00
janonymous
ef467ddee4 Python 3: Replacing unicode with six.text_type for py3 compatibility
The "unicode" type was renamed to "str" in Python 3.
Use six.text_type to make swiftclient compatible with Python 3.

For more information about changes needed for py3
compatibility, see:
https://wiki.openstack.org/wiki/Python3

Change-Id: Ic65607a69935652a1874340928f626fbcc35c014
2015-06-28 07:40:26 +05:30
Pradeep Kumar Singh
e596489020 Added check for negative segment-size
Closes-Bug: #1453135

Change-Id: Ia9c2b27d998e6ac1889cc74c12e456c06ecd84d9
2015-06-23 10:50:34 +09:00
Clint Byrum
7c716997a8 Fix docstring typo for SwiftService.upload
The option from argparse in shell is 'header' and that is what is used
in the code.

Change-Id: I5c889192ef7c46c299dc0ec7cbc7c4d027dae6d5
2015-06-18 09:04:33 -07:00
Pradeep Kumar Singh
794b125e76 SwiftClient object upload beginning with / or "./"
Currently SwiftClient populate response dictionary before
removing "./" or "/" at begining of object name. This patch
fixes that by changing that order.

Closes-bug: #1412425
Change-Id: I80222754caba5d42a468f4677ac539e46682dd31
2015-06-17 12:27:43 +05:30
Clay Gerrard
17feec709c Add some bash helpers for auth stuff
Change-Id: If61ac9a050e7a115f37dbf4e74b904ac5dfd2052
2015-06-15 12:38:21 -07:00
Andreas Jaeger
e48f487335 Fix inconsistent usage of "Positional argument"
All help texts uses "Positional argument" with the exception of tempurl.
Update tempurl to use this as well so that the formatting tools work
fine and can show this nicely on
http://docs.openstack.org/cli-reference/content/swiftclient_commands.html#swiftclient_subcommand_tempurl
like it's done for other options.

Change-Id: Ib5502c23b236986bea5a4d4a63a46fca411a8494
Closes-Bug: #1463081
2015-06-08 20:20:21 +02:00
Christian Schwede
7f2ee7322b Add connection release test
This patch adds a small test to ensure a connection
is released after all chunks have been consumed.

It's a follow up to commit 8756591b and added to ensure
there will be no regression in the future (this test
fails also with that patch not applied).

Change-Id: I6a6fcd26879eb2070f418c8770a395ff6c30aa51
2015-06-05 07:17:31 +00:00
Alistair Coles
f0aad4c364 Run functional tests using keystone auth options
Makes the existing functional tests run using three
auth modes: tempauth (v1), keystone v2 and keystone v3.
The latter uses an account in a non-default domain
(which exists in devstack setup).

This should help avoid regressions in handling different
auth options.

Change-Id: Ifee6a4fa418242892bf73eda5e2cad7b803b1bee
2015-06-04 12:54:43 +00:00
Jenkins
ec3e2ab3a0 Merge "Allow reading from object body on download" 2015-06-04 12:08:07 +00:00
Alistair Coles
259b434ae2 Add passenv to tox.ini to make functests run with tempauth
Since tox version 2.0.0 env vars are not passed to the test
env, which means that the SWIFT_TEST_CONFIG_FILE var is not
passed in to tox -e func env. That means that both times
tox -e func runs it is using keystone auth, and never using
tempauth.

Related-Bug: 1455102

Co-Authored-By: Christian Schwede <cschwede@redhat.com>

Change-Id: I23dcdbcde0bf8adc9429eb2d294a2c778005d136
2015-06-03 17:45:14 +01:00
Alistair Coles
f0cc3be2ac Make default get_auth timeout be None
Setting timeout to a default of False in get_auth()
results in a requests timeout of 0.0 in keystoneclient,
which causes a connection failure.

This bug will cause func tests to not run when using
keystoneauth.

Added unit tests to verify correct default timeout is set
in get_auth().

Drive-by: remove what seems like a stale TODO comment

Change-Id: I17c781ce160a682b1768d315422ade0cdd2df198
2015-06-03 12:03:30 +01:00
Alistair Coles
71a1835193 Document missing functional test config option
Adds doc for account_username option to sample test.conf.
This option was added in [1].

[1] change id Ic484e9a0c186c9283c4012c6a2fa77b96b8edf8a

Change-Id: Ic86b274e9d954822da521360981f796d61efaad9
2015-06-02 11:13:38 +01:00
Jenkins
49483a3b11 Merge "Compare each chunk of large objects when downloading" 2015-06-01 17:18:21 +00:00
Jenkins
bcca25a2c8 Merge "Stop decoding object content" 2015-05-29 08:13:16 +00:00
Tim Burke
ff0b3b02f0 Compare each chunk of large objects when downloading
This allows the use of --skip-identical when downloading SLOs and DLOs,
while still only requiring one request for normal objects.

Change-Id: I237ec5a8cc4d1119b6d3f166db81a977a50a4e4e
Related-Bug: #1379252
2015-05-27 17:40:24 -04:00
Jenkins
c15e81af9b Merge "be more explicit in the --version CLI option" 2015-05-26 20:09:04 +00:00
Tim Burke
7d5c85ad10 Stop decoding object content
Previously, we had urllib3 (via requests) automatically decode all
responses with a Content-Encoding of deflate or gzip. This included
object downloads, which would in turn cause etag or content-length
mismatch errors. (See bug 1338464)

This was apparently added in response to a third-party proxy sitting
between the client and server which, having observed that the client
would accept gzip-encoded content while the server sent an unencoded
response, would perform the compression. (See bug 1282861)

Now, we'll no longer let requests send any default headers, nor do any
decoding.

Change-Id: I6cc30a5c12e37de06d7322533a3c36ad15397cc8
Closes-Bug: 1338464
Related-Bug: 1282861
2015-05-22 13:24:46 -07:00
Tim Burke
317df7e527 Remove simplejson dependency
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
2015-05-20 18:14:53 -07:00
Jenkins
52b849217f Merge "Add tests for uploads deleting DLO segments" 2015-05-21 00:47:28 +00:00
Jenkins
53432b5739 Merge "Add test for timeout being passed to keystone client" 2015-05-21 00:44:51 +00:00
John Dickinson
888bf6f1a0 be more explicit in the --version CLI option
Change-Id: I14f33c7ea90ab1fe58aa67f1ff70e527c88cd141
2015-05-13 16:46:14 -07:00