252 Commits

Author SHA1 Message Date
OpenStack Jenkins
52893e3ce5 Merge "Updated from global requirements" 2.0.3 2014-02-27 04:53:09 +00:00
Jenkins
6cc1324e6e Merge "Add LengthWrapper in put_object to honor content_length param" 2014-02-27 04:52:59 +00:00
Jenkins
cfddbde81f Merge "swift.1 manpage fix for groff warnings" 2014-02-27 04:52:58 +00:00
Clay Gerrard
3d35a3e989 Add LengthWrapper in put_object to honor content_length param
Closes-Bug:#1284360

Change-Id: Iec63a3fde77bb8195bfe46c764403b367999ff43
2014-02-25 01:12:51 -08:00
OpenStack Jenkins
f09abbf116 Updated from global requirements
Change-Id: I36af2ac149fe6b56ee3e0c54f13f1592c2f97343
2014-02-23 09:32:05 +00:00
Jenkins
f4e057923c Merge "Remove useless statement" 2014-02-19 23:17:10 +00:00
Fabien Boucher
b5b440d9b6 Remove useless statement
Change-Id: Ide74b417ede6a4976c33fc835d366ed472033fd0
2014-02-19 14:09:50 +01:00
Jenkins
21cec82ff1 Merge "Add missing backslash." 2014-02-18 06:24:59 +00:00
Jenkins
029ade17d2 Merge "Only run flake8 on swiftclient code" 2014-02-18 06:22:52 +00:00
Thomas Goirand
822274b637 swift.1 manpage fix for groff warnings
The current manual page contains hyphens where a minus sign
was intended. By default, "-" chars are interpreted as
hyphens (U+2010) by groff, not as minus signs (U+002D).
Since options to programs use minus signs (U+002D), this
means for example in UTF-8 locales that you cannot cut and
paste options, nor search for them easily.

This patch fixes this by escaping hyphens with backslashes,
and also fixes a typo: s/retreived/retrieved/.

Change-Id: If954c91eebe7b39bdac792f1f126998d2e3bcb8e
2014-02-18 11:42:18 +08:00
Jenkins
0aa0f4f6cc Merge "Add option to skip downloading/uploading identical files" 2014-02-18 01:45:54 +00:00
Tristan Cacqueray
380e830874 Remove multipart/form-data file upload
The requests 'files' parameter adds this 'Content-Type: multipart/form-data'
HTTP header and the whole multipart body data get stored with the object.
This also create a memory hog issue because files are loaded in memory before
being actually sent. This patch removes this behavior and restores what was
done before, ie: direct uploading.

This patches also fixes an issue in requests, when used with glance
CooperativeReader it mis-calculates content-length leading to chunked encoding
for raw upload.

Change-Id: Ie5b0a1078bedd33f09c6157f48b5f88116c589fa
Closes-Bug: #1280072
Closes-Bug: #1280275
2.0.2
2014-02-14 16:51:20 +01:00
John Dickinson
79f189a593 Fix --insecure option on auth
Change-Id: Ibe76d98d6075b84cbdb370b48f3498ab848142ad
2.0.1
2014-02-13 23:37:08 -08:00
Samuel Merritt
1bee485b36 Only run flake8 on swiftclient code
In particular, this skips the "build" directory, which is prone to
containing stuff that doesn't comply with all the hacking checks. The
actual code we care about all lives in three places, so let's only
check those.

Change-Id: I4a3be59913ad85a5a9e91d254f4d3f4b0b1cc7b7
2014-02-13 22:34:44 -08:00
Jenkins
19d7e1812a Merge "Port to python-requests" 2014-02-14 00:41:39 +00:00
Jenkins
0c7264c21d Merge "Remove extraneous vim configuration comments" 2014-02-13 20:20:32 +00:00
yangxurong
4e15bc7120 Remove extraneous vim configuration comments
Remove line containing

comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

Change-Id: I31e4ee4112285f0daa5f2dd50db0344f4876820d
Closes-Bug:#1229324
2014-02-13 17:44:29 +08:00
tanlin
c3107cd665 Rename Openstack to OpenStack
Change-Id: I091b1d2de41ff59b21ce136738e2f69b759d682b
2014-02-13 16:45:38 +08:00
Tristan Cacqueray
b182112719 Port to python-requests
Currently, httplib implementation does not support SSL certificate
verification. This patch fixes this. Note that ssl compression parameter
and 100-continue thing is still missing from requests, though those are
lower priority.

Requests now takes care of:
* proxy configuration (get_environ_proxies),
* chunked encoding (with data generator),
* bulk uploading (with files dictionary),
* SSL certificate verification (with 'insecure' and 'cacert' parameter).

This patch have been tested with requests 1.1.0 (CentOS 6) and requests
2.2.1 (current version).

Change-Id: Ib5de962f4102d57c71ad85fd81a615362ef175dc
Closes-Bug: #1199783
DocImpact
SecurityImpact
2014-02-12 13:21:26 +01:00
Christian Schwede
9b3ec3705f Add option to skip downloading/uploading identical files
swift has already the upload option "--changed" to upload only changed
files. This patch adds a similar feature by comparing the md5 of the
local file to the remote object etag.

When used in combination with download the MD5 hexdigest of each file
is sent with an "If-None-Match" header to skip downloading identical files.

When used in combination with upload the MD5 is compared to the remote
etag by using the already existing HEAD request.

Change-Id: I727b0456558c6a7742b2428c6d1c45c4bfaf66e9
2014-02-11 09:13:26 +00:00
Jenkins
f13288ae32 Merge "Fix swiftclient help" 2014-02-10 21:51:58 +00:00
Jeremy Stanley
ef814bdf51 Remove tox locale overrides
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.

Change-Id: If4e025e22248d06b77e9d4d8f4e4815776428b9d
Closes-Bug: #1277495
2014-02-10 03:11:19 +00:00
Christian Schwede
545ea2e032 Fix swiftclient help
Command help was wrong in some cases. While we're at it, add some
defaults to help and change some brackets to be consistent with
http://en.wikipedia.org/wiki/Command-line_interface#Command_description_syntax

Change-Id: I5d7b2a703294d97fc5e3de43b9ec375c3ea55a6e
2014-02-07 13:48:51 +00:00
Shane Wang
0d3f4a0aa2 Fix misspellings in python swiftclient
Fix misspellings detected by:
* pip install misspellings
* git ls-files | grep -v locale | misspellings -f -

Change-Id: I2fb042b3d9eb59cd404c52c775e5cc870e6157e1
Closes-Bug: #1257295
2014-02-07 13:58:17 +08:00
Sergio Cazzolato
d387c61daa changed things because reasons
Dictionaries added in texts to improve readability in case there
are 2 params

Change-Id: I064cceeaa56b232504c6f0b6c215c9c5dbb7fcef
2014-02-06 17:31:32 -08:00
Chmouel Boudjnah
504e871967 Add missing backslash.
The one character commit of the day that needed two iterations.

Change-Id: I3bfe91c7e164d45d03348b18e0a457314b8baec7
2014-02-05 12:15:15 +01:00
Jenkins
9b73547b7d Merge "Install manpage in share/man/man1 instead of man/man1" 2014-01-31 17:32:51 +00:00
Jenkins
fa15f66932 Merge "assertEquals is deprecated, use assertEqual" 2014-01-31 09:13:46 +00:00
OpenStack Jenkins
58e88bb168 Merge "Updated from global requirements" 2014-01-31 09:10:24 +00:00
Jenkins
feb514a207 Merge "Add capabilities option" 2014-01-31 08:55:27 +00:00
John Dickinson
95aa3e96f2 match hacking rules in swift
Change-Id: Iee02978f38ca020754f52ceaed6aa3684fa87bc9
2014-01-24 14:53:17 -08:00
OpenStack Jenkins
b9b8b8b423 Updated from global requirements
Change-Id: Icebd5bed50a50930bde0305191e32628d93348c0
2014-01-24 22:41:07 +00:00
Christian Schwede
65d7a136f6 Install manpage in share/man/man1 instead of man/man1
According to FHS 2.3 the correct place to install the manpage for a
binary in /usr/local/bin/ would be /usr/local/man/.

However, on Debian/Ubuntu-based systems /usr/local/man/ is a link to
/usr/local/share/man/ and on other systems /usr/local/man/ might not
exist at all.

Even worse, if the client is installed in /usr/bin/ the manpage
should should be installed in /usr/share/man, but will be installed
in /usr/man/ which is completely wrong.

This patch fixes this and uses share/man/man1 as common prefix. Doing
this will install the manpage either in /usr/local/share/man/man1 or
/usr/share/man/man1.

Partial-Bug: 1269715
Change-Id: I590932f00476eacd434cdae012fd62010845581d
2014-01-20 11:24:16 +00: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
Dirk Mueller
eac3c72924 assertEquals is deprecated, use assertEqual
Change-Id: I226d9046d25d681beea60d38b029b71f9e6bf86c
2014-01-17 11:31:00 +01:00
Fabien Boucher
533c9c5ba1 Add capabilities option
This patch adds a capabilities option on swiftclient.
This option uses the new /info endpoint to request the
remote capabilities and nicely display it.

Change-Id: Ie34b454511d5527e402e66e1fdb72120f427f2fd
2014-01-17 10:26:34 +01: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