218 Commits

Author SHA1 Message Date
John Dickinson
95aa3e96f2 match hacking rules in swift
Change-Id: Iee02978f38ca020754f52ceaed6aa3684fa87bc9
2014-01-24 14:53:17 -08:00
Jenkins
b4907e0c81 Merge "retry on ratelimit" 2014-01-18 17:07:16 +00:00
Jenkins
e2c7f7b80f Merge "Replace xrange in for loop with range" 2014-01-18 17:05:46 +00:00
Christian Schwede
63c9917085 Install swiftclient manpage
Currently the existing manpage isn't copied to /usr/local/man/man1
when installing swiftclient from source. This patch fixes this.

Change-Id: Ib2ee091d5e1d4c37a4e5a00f50fa19df44bd3c41
Partial-Bug: 1269715
2014-01-16 10:26:06 +00:00
Wu Wenxiang
a1cf366a0b Replace xrange in for loop with range
xrange is not supported in python 3, so replace it with range since no
large size lists involved.

Closes-Bug: #1237717

Change-Id: I4e5e0782153d32c8beee03f7d871722ed4352859
2014-01-14 21:49:44 +08:00
Jenkins
20cd3402b2 Merge "Add --object-name" 2013-12-25 11:20:10 +00:00
Taurus Cheung
26ecec0f6d Add --object-name
Add parameter --object-name, which:
1) Sets target object name when upload single file
2) Sets object prefix when upload a directory

Change-Id: Idc4357c3355e66d31c100540b901e70db20b03c3
Closes-Bug: 1012979
2013-12-24 10:27:17 +08:00
John Dickinson
5187fd313f retry on ratelimit
Added a retry_on_ratelimit parameter to the Connection
class so that ratelimited requests can be retried.

DocImpact

Change-Id: I2817a7ea0ed2d69a7659e80111fbd2c91a75d530
2013-12-23 13:53:18 -08:00
Jenkins
2d15780a46 Merge "Fix help of some optional arguments" 2013-12-21 09:07:28 +00:00
Sahid Orentino Ferdjaoui
222f283b22 Fix help of some optional arguments
Some positional arguments are optional but the help indicate
they are mendatory and can be confuse for an user.

  swift delete <container> [object]
  swift post <container> [object]

Change-Id: I7be525905b51d3ef160b0f47194e817b5cba0f9b
2013-12-18 10:12:22 +00:00
Jenkins
3580bd90d0 Merge "Updates tox.ini to use new features" 2013-12-16 09:02:09 +00:00
Jenkins
0ae2b58f2d Merge "Enable usage of proxies defined in environment (http(s)_proxy)." 2013-12-14 09:37:38 +00:00
Sushil Kumar
ec795cfdfa Updates tox.ini to use new features
tox 1.6 allows us to skip the sdist step, which
is slow. This does that.
It also allows us to override the install line.
In this case, it's important as it allows us to
stop getting pre-release software we were not
asking for.

Original patch by Monty Taylor, talked about here:
http://lists.openstack.org/pipermail/openstack-dev/2013-September/015495.html

Change-Id: Id751f7d5d40a80d348a5f5936539d9462b40b14b
2013-12-12 09:04:44 +00:00
Jenkins
38ae02928d Merge "Fixes python-swiftclient debugging message" 2013-12-12 08:48:58 +00:00
John Dickinson
50ad1e0b14 Fix Sphinx version issue
Change-Id: Ib72ebf210486972538f5d2ef7eb225d57f84eeac
2013-12-11 16:17:16 -08:00
Davide Guerri
716b4e722c Enable usage of proxies defined in environment (http(s)_proxy).
As far as proxies usage is concerned, keystone-client API and swift-client API behave differently because the former uses python Request library while the latter uses raw httplib. As a result, Keystone authentication honors environment variables http_proxy, https_proxy and no_proxy while Swift doesn't.

This patch, which code is mainly borrowed from Python Requests, makes Swift
data connections and Swift authentication connections behaving homogeneously.

Change-Id: Ic8a0089c35c458d7ed96e572e22429014298fe4c
2013-12-10 12:12:28 +00:00
Jenkins
1f3ab4b41a Merge "Skip sniffing and reseting if retry is disabled" 2013-12-10 00:19:00 +00:00
Jenkins
b0f794800c Merge "Don't crash when header is value of None" 2013-12-07 10:12:08 +00:00
Chmouel Boudjnah
983988093f Don't crash when header is value of None
Before commit 7d88d14d (http://git.io/hhJWdQ) swifclient used to accept
header value with the type None :

{'Headers': None}

It would just be happy with it with those None headers and not process
them, reinstate the old behavior.

Closes-Bug: 1256441
Change-Id: Ic7f80c38ef2ce9ef1687ed0d6d65521f2e754905
2013-12-06 13:28:01 +01:00
Jenkins
e100fd28ab Merge "Fix download bandwidth for swift command." 2013-12-03 01:30:48 +00:00
Jenkins
dbc6686b5e Merge "Add close to swiftclient.client.Connection" 2013-11-29 22:01:24 +00:00
jola-mirecka
9b7e24c449 Fix download bandwidth for swift command.
We noticed a difference in download bandwidth while using
authentication details and pre-auth information for download.
Download using authentication details included authentication
time into the download bandwidth at each call of the function.
This time should have been excluded from download bandwidth.

This patch set is adding a timer variable to the client library.
That allows to accurately measure and store the time of each action.
Then while printing the download bandwith in the swift command
authentication time is excluded from bandwidth.

Change-Id: I63df9023e169f637f120ae9e25dac9c90a4e75a0
Fixes: bug #1197443
2013-11-28 13:02:54 -05:00
Zhenguo Niu
0ef054585a Updates .gitignore
To ignore swap files from getting into repository
currently the implemented ignore is *.swp
however vim adds more swap files if these files exists,
so improving this with *.sw?

Change-Id: I48846345de6838735d2d2e46328698f6a526f397
Closes-Bug: #1255876
2013-11-28 22:39:24 +08:00
Jenkins
a253b5cecd Merge "Allow custom headers when using swift download (CLI)" 2013-11-27 10:16:55 +00:00
Jenkins
04e0cb2783 Merge "Add verbose output to all stat commands" 2013-11-21 08:50:33 +00:00
Matthieu Huin
3cabda8c48 Allow custom headers when using swift download (CLI)
This fixes bug #1051046

A repeatable option, --header or -H, is added so a user can specify
custom headers such as Range or If-Modified-Since when downloading
an object with the swift CLI.

Change-Id: I1f7dcf64cf625f2e5a4488c210894cfe6e0d5974
2013-11-04 17:41:55 +01:00
Alex Gaynor
ff6ba367fa Replaced two references to Cloud Files with Swift
Change-Id: I721f2b25a255a829c625b34928b066df3cd3e632
2013-11-01 11:40:44 -07:00
Romain Hardouin
4b78b4d136 Fix a typo in help text: "downlad"
Change-Id: Icd6cf75f3c5758c13118060c19c9c000e28ef3ae
Closes-Bug: #1245082
2013-10-27 01:41:04 +02:00
Feng Liu
9fe79a4aac Add close to swiftclient.client.Connection
Change-Id: I2f5fa9c46886607a9ba99e8915ea84ac4975d004
2013-10-23 11:31:10 +08:00
Jenkins
775a24b1bc Merge "enhance swiftclient logging" 2013-10-18 21:43:05 +00:00
Leah Klearman
b682935055 enhance swiftclient logging
* log to debug for successes and info for errors
* remove dead code, neither body or raw_body are sent in kwargs
* include resp.reason and response headers in logging
* remove trailing \n in logging. users who want them can set logging.basicConfig(format=FORMAT)
* add --info option to swift cli

Change-Id: If07af46cb377f3f3d70f6c4284037241d360a8b7
2013-10-17 16:05:36 -07:00
Jenkins
1f2717e334 Merge "Extend usage message for swift download" 2013-10-17 17:42:42 +00:00
Jenkins
efde2378c2 Merge "user defined headers added to swift post queries" 2013-10-17 16:59:03 +00:00
Pete Zaitcev
e08ec3ab8a Clarify main help for post subcommand
Fixes bug 1231321

Change-Id: I7014aa160ebe5ba0bc5a91de05e6858fc58f69e0
2013-10-14 15:04:40 -06:00
Florent Flament
c81a9edd1f Fixes python-swiftclient debugging message
Appends the container's name to the URL displayed, to be used to
replay the queries with curl.

Replaying the curl commands displayed by "swift --debug list
<container>" now works properly.

Example:
$ swift --debug list test-container
...
DEBUG:swiftclient:REQ: curl -i http://10.0.48.134:8080/v1/AUTH_6c554b8dd3d74e44878eddb92caf8687/test-container?format=json -X GET -H ...
...

Change-Id: I7ec33d185fedc44a529c016d38f841fde39d20d0
Closes-Bug: #1238612
2013-10-11 14:06:35 +02:00
Jenkins
1aa85960fd Merge "Make pbr only a build-time dependency." 2013-10-10 22:51:47 +00:00
Samuel Merritt
7d61c54399 Make pbr only a build-time dependency.
This lets you build python-swiftclient packages that don't require pbr
to be installed at all. You would need pbr on the machine running
rpmbuild / debuild, but not on the machines that install the packages.

Unfortunately, this does not make python-swiftclient able to be
installed via pip 0.3.1 on Lucid; you'll need to uninstall the system
python-pip package and install a new pip some other way. Given that
pip < 1.3 doesn't perform SSL certificate validation for pypi (trivial
MITM attack, anyone?), you'd probably want to get a new pip anyway.

Change-Id: I85d4d77aacf094e48d39e48e750594b95dbc7af0
2013-10-10 11:57:47 -07:00
Clay Gerrard
d687060a44 Add verbose output to all stat commands
When you stat a container or object with the verbose flag the full path of the
reousrce will be displayed with the token similarlly to how an account stat
displays the auth url and token.

 * move some logic out of bin/swift.st_stat to test it
 * new module swiftclient.commnad_helpers for code you want to test
 * moved prt_bytes into swiftclient.utils to test it
 * fixed IndexError with prt_bytes on sizes >= 1024Y

Change-Id: Iaaa96e0308b08c554205b0055b8a04de581fefa4
2013-10-09 14:31:47 -07:00
Dirk Mueller
0cded7cfed assertEquals is deprecated, use assertEqual (H602)
Change-Id: I75dac8693c079a153004f77dc1cda48f3ac6f51d
2013-09-30 22:24:31 +02:00
Yuan Zhou
dbdbaa0321 Skip sniffing and reseting if retry is disabled
Bypass sniffing entirely if retries has been disabled.

Fix bug #1216981

Change-Id: I593bdc56ca139af5a7f2ca2783ef2de2a96c94fb
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
2013-09-29 21:37:07 +08:00
Matthieu Huin
afa1f9f76d user defined headers added to swift post queries
This commit fixes a problem where headers passed through the option
--header were not taken into account when doing "post" queries.

Change-Id: Ia34808c53a1816d9956a98e0803d8c4d20d2ad44
Closes-Bug: #1226256
2013-09-27 11:40:34 +02:00
Jenkins
68dde8dd51 Merge "fix bug with replace old *LOs" 2013-09-22 22:54:11 +00:00
Monty Taylor
66e8c5a384 Sync with global requirements
Specifically, removing d2to1 is the important part. While we're at it
though, use hacking to get the pyflakes/pep8 pins.

Change-Id: Ic4a43955526fcde313ad2f2afec8fafeb87f37a6
2013-09-13 11:02:05 -05:00
David Goetz
266217e32c fix bug with replace old *LOs
Change-Id: I9e6278b62608cf36fa7e5e228f234cc8199c17fc
2013-09-10 13:12:29 -07:00
Alexis Lee
47c33cc4a3 Extend usage message for swift download
Make it clear that you do not have to provide either the container or
object positional parameters, and what swiftclient will do if you omit
them.

Change-Id: I3766fc1eabd51f197e2175771af579577a96c192
2013-09-06 14:57:34 +01:00
Jenkins
0278998398 Merge "Added support for running the tests under PyPy with tox" 2013-08-29 22:23:27 +00:00
Alex Gaynor
d352d831a5 Added support for running the tests under PyPy with tox
This is a precursor to having them run under check and gate.

Change-Id: Ia512b68b5b47a88d5f7c1015cdf7151c322d293d
2013-08-28 09:44:51 -07:00
Stanislaw Pitucha
a47d3d6468 Remove redundant unit suffix
Transfer speed already has a "MB/s" unit. The "s" suffix was probably a
copy/paste mistake.

Change-Id: Iccd7894d5ca11aac8a9f98365834c5d3deef0720
2013-08-28 16:26:28 +01:00
Jenkins
6c041058da Merge "Reformat help outputs" 2013-08-26 23:42:48 +00:00
Jakub Krajcovic
b0eb857b69 Reformat help outputs
Reformatted the help outputs in the swift client to bring them more
in line with the rest of the openstack clients. Changes were added to
all of the st_command_help variables and a new variable
st_command_options was added to help with correct formatting of
help outputs.

Change-Id: I0c549cf96292384ddb36b43ecec41a883d8b2e13
Implements: changes to help outputs
2013-08-19 20:45:00 +10:00