| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Make it so that swift <cmd> --help will print the info
subcommand help for info and tempurl just like all the
other subcommands.
Also add unit tests to verify subcommand help.
Change-Id: Id3666dcf72a9727fbfda2f74c23293ada1c53aa0
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Client already supports -H/--header option when creating container
or uploading objects. This patch extends this option to support
Storage Policy.
e.g.,
swift post con -H 'X-Storage-Policy:p1'
This creates one container 'con' with storage policy 'p1'.
swift upload con obj -H 'X-Storage-Policy:p2'
This creates container 'con' with storage policy 'p2' and uploads
object 'obj' into it.
Also fixes segmented uploading to non-default storage policy container
When uploading large objects with segmentation to container with
non-default storage policy, there will be another 'xxx_segments'
container created, but with the default storage policy. This
results all the segments to be stored with the wrong policy.
This patch is for the Storage Policy feature, and also
compatible with old versions w/o Storage Policy support.
Change-Id: I5c19e90604a0bcf2c85e1732b8a0b97ae6801994
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Temporary URLs allow a user to sign an object URL with a shared
secret to so that the object can be downloaded without auth for
a specified amount of time.
http://docs.openstack.org/trunk/config-reference/content/object-storage-tempurl.html
Change-Id: Ife0b6c98c975e074d4dad0a31145573b784747c5
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| | |
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.
Change-Id: I90270908d27f0a57c184d5a547bb1af9b1381c95
|
| |\ \ |
|
| | |/
| |
| |
| | |
Change-Id: I9aaadbaba2c43a12a83f8200eaaa96f48c52028e
|
| |/
|
|
|
|
|
|
|
|
|
| |
get_auth() in client.py raises an exception if
tenant_name is not included in the os_options
dict. This is overly constrained since tenant_id
is equally sufficient. This patch modifies
get_auth to require either tenant_name
or tenant_id.
Change-Id: Ibbcda1704637eb887efa5895579d260a1e072327
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To signal the file encoding to Emacs, one can add a line with
-*- coding: your-favority-encoding -*-
Python also understands such a line, infact it also understands the
line if it says "encoding" instead of "coding".
However, it is only "coding" that has an effect in Emacs. Furthermore,
since "encoding" is not recognized, Emacs will prompt the user with a
scary looking message when the file is opened:
The local variable list in __init__.py contains values that may not
be safe.
Using the correct variable name fixes this.
(The file contain only ASCII characters at the moment, so the line
could alternatively be removed completely.)
Change-Id: Ie6b4f41043bf97bb59e3de403e4794c302d81783
|
| |
|
|
|
|
|
|
| |
The extra " was visible on
http://docs.openstack.org/developer/python-swiftclient/swiftclient.html
Change-Id: I7d61c8259a4f13464c11ae7e3fa28eb3a58e4baa
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* E111 indentation is not a multiple of four
* E128 continuation line under-indented for visual indent
* E265 block comment should start with '# '
* E713 test for membership should be 'not in'
Tested with pep8 version 1.5.6 (2014-04-14).
Change-Id: I7f85c143d463c501a0df20724362ad5c0f2d4dde
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes three issues that were found running
functional tests with Python 3:
1. python-requests sets 'application/x-www-form-urlencoded' as
content-type if the input is not a string object and no
content-type is given.
2. Encoding of the headers is now only done if required. This
prevents comparisons between unencoded headers and encoded
prefixes and avoids unnecessary forloop-iterations.
One unittest was extended to ensure it works for unencoded
and encoded headers with or without the prefix.
3. Functional tests recently switched to using byte data for
testing, thus the comparison needs to be a byte object as well.
Change-Id: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
Change-Id: I98b6e46cb84962ffdac02e9007b5ad3b30bc2817
|
| |/
|
|
|
|
|
|
|
| |
The command descriptions did not include a "." at the end but the
argument description does. Add "." everywhere.
Also capitalize and add "." for parameter of capabilities.
Change-Id: I2355e0d0c38170d669c8e568361faf4b68203d16
|
| |
|
|
|
|
|
|
|
|
| |
Don't encode standard headers keys but just the x-*-meta- ones. That
fixes py3 to not have them casted as bytes and not properly passed to
the requests kwargs.
Other trivial py3 fixes along the way.
Change-Id: I91b95f32fb2aec9b20892a5bb95fd1bc65d002f3
|
| |
|
|
|
|
|
|
|
| |
Coverage for swiftclient.client is 71% with these tests.
Unit tests have been moved into another subdirectory
to separate them from functional tests.
Change-Id: Ib8c4d78f7169cee893f82906f6388a5b06c45602
|
| |
|
|
| |
Change-Id: I38e41a7ce9f91b5b1785491c6cd10dbbba9562a2
|
| |
|
|
|
|
|
|
| |
This is not needed since already done by requests.
(and it was buggy with py3).
Change-Id: I9505c56be2f53eb8071aea3d5fb9d8caa9508e34
|
| |
|
|
|
|
| |
It wasn't used anymore since moved up to requests (and it fails in py3).
Change-Id: Ic8a80ae09ca6445696a9cf34ffb503c5ff51bc79
|
| |
|
|
| |
Change-Id: I42cff32fbf3febd6dd6a7171b9214f93b4414f9a
|
| |
|
|
|
|
| |
This allows better connection pooling and may improve performances.
Change-Id: I69e986b7387dd3ac281731b8355a3eec34a537f8
|
| |
|
|
|
|
|
|
|
|
|
| |
* On Python 3, the printer doesn't encode Unicode to utf8 anymore, since
print() expects a Unicode string.
* Update unit tests for Python 3 since repr() doesn't escape non-ASCII
characters in Unicode strings anymore:
http://legacy.python.org/dev/peps/pep-3138/
Change-Id: I89471019d691a46651312d6a49964b719192148a
|
| |
|
|
|
|
|
|
|
| |
On Python 3, urllib.parse.quote() accepts bytes and str (unicode) types and
always return str (unicode).
Add also more tests with non-ASCII characters.
Change-Id: I8e0f19da7240e874392327d0da074ed4abb7d213
|
| |
|
|
|
| |
Change-Id: Ic3f9a733329c19c4e0bb85676da28a8d1d74232b
Closes-Bug: 1302566
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
Replaced it with traditional tuple unpacking. Needed for Python 3 support.
Change-Id: I714f32859f9b1ec7216eae777ea8968b5826af3b
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This is needed for Python3 compatibility.
Change-Id: Iadd21e4b3a936b601a69f1db2aba8e1597f13fc3
|
| |\ \ \ |
|
| | | | |
| | | |
| | | |
| | | | |
Change-Id: I3ae71259ccc49a5d8a852388784c3dfd577df50a
|
| |\ \ \ \
| |/ / / |
|
| | | | |
| | | |
| | | |
| | | | |
Change-Id: Ia67807667b4b5177d83cce9fcf16d98dc5024fbc
|
| |\ \ \ \
| |_|_|/
|/| | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
By default, the HTTPConnection class expose the raw.read urllib3
function which doesn't do any decoding on the http response.
We can fix this by passing decode_content=True to raw.read().
Change-Id: I7d42d31ae516705d1bde2769e642931308116c7a
|
| |\ \ \ \
| |_|_|/
|/| | | |
|
| | | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Replace unicode with six.text_type
* Replace basestring with six.string_types
* The long type doesn't exist in Python 3 anymore: replace 1L with long(1) and
only test this type with Python 2
* Fix quote(): quote the URL if the string is a byte string. Use "bytes" type
instead of "str" to be Python 3 compatible.
Change-Id: I1df5aa85e4e7d07191fb5c654d52fc4bd8b9f440
|
| |/ /
| |
| |
| |
| |
| | |
Use six.moves to fix imports on Python 3.
Change-Id: I35b9405690e9f0607b24d79aa7c00830df954c41
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
dict.iteritems() has been removed in Python 3. In Python 2, dict.items()
creates a temporary list, but Samuel Merritt wrote:
"The size of the data is small enough that we don't need to worry about the
memory consumption; it's all just HTTP headers."
Change-Id: Iac427b8bbd032e4a1efb2bdc84a3968217eb6ddf
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To make bin/swift importable for testing it needs to be renamed/moved.
The final idea is to move it to swiftclient/shell.py and add only a stub
in bin/swift to import swiftclient/shell.py.
However, doing this in a single step makes reviewing very hard, because
now there are > 1400 lines deleted from bin/swift and added to
swiftclient/shell.py - Gerrit doesn't detect the moved file.
For example: https://review.openstack.org/#/c/73710/2/
This patch first moves the code to swiftclient/shell.py and uses
setup.py/cfg to create the stub file in bin/swift. A follow up
(https://review.openstack.org/#/c/76489/) will then add the stub itself
in bin/swift (and remove the entry in setup.py).
The change to tox.ini is related to bug 1290562 and can be removed in
the future.
Change-Id: Id86392ccaf09e1d80a5d808fb49827d6d18c2588
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
urlparse netloc contains the TCP port if presents.
There is no need to provide conn.port when building
CLientException.
Change-Id: Id3e4fa8c4f4ab2ad693b0e8702ab69ed7c291830
|
| | |
| |
| |
| |
| |
| | |
Closes-Bug:#1284360
Change-Id: Iec63a3fde77bb8195bfe46c764403b367999ff43
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
Change-Id: Ide74b417ede6a4976c33fc835d366ed472033fd0
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Change-Id: Ibe76d98d6075b84cbdb370b48f3498ab848142ad
|