3928 Commits

Author SHA1 Message Date
Samuel Merritt
2b55709625 Make swift-form-signature output a sample form
swift-form-signature would give you the required expiration-time and
HMAC signature, but it wouldn't help you actually construct the HTML
form. To do that, you had to go look at the formpost middleware's doc
string and make up a form yourself.

For convenience, this commit makes swift-form-signature output a
sample form with the computed values filled in already; the user only
needs to fill in the Swift cluster's hostname.

Change-Id: I70d70a648b78b382dbfbe8ff918e6158a7f6a0ab
2014-08-05 11:11:03 -07:00
Samuel Merritt
4f2bb9f271 Make swift-form-signature testable
Moved the body of bin/swift-form-signature into
swift/cli/form_signature.py, like was done with swift-ring-builder and
others. Added a couple basic tests; there's not 100% coverage, but
it's better than the 0% coverage we had before.

It's almost a straight forklift, but I changed exit() calls to return
statements.

Change-Id: Ie2f702c070da24d9cdface83b9e838e9e2965085
2014-07-24 14:38:53 -07:00
Jenkins
e788fd37dd Merge "Fix trivial typos" 2014-07-24 19:06:56 +00:00
Jenkins
51e8463db3 Merge "Fix a couple small things in formpost doc string" 2014-07-24 19:06:26 +00:00
anc
6aff48c6f1 Fix trivial typos
Fixes a few typos I have stumbled across recently.

Change-Id: Ib232924f6b23c08578c52a8dd63aaaa8789f9da7
2014-07-24 16:23:13 +01:00
guang-yee
ee14d58d84 Use auth_token from keystonemiddleware
auth_token middleware in python-keystoneclient is deprecated and has
been moved to the keystonemiddleware repo.

Change-Id: Ia04aa83348e0776cb3239cb5420ee1450a990d5b
Closes-Bug: #1342274
2014-07-23 10:59:10 -07:00
Jenkins
3e78432cb1 Merge "lock_file race fixes" 2014-07-23 00:23:56 +00:00
Jenkins
c2a8bc2ed7 Merge "typo tradeoff -> trade-off" 2014-07-22 23:58:16 +00:00
Jenkins
393f735e43 Merge "Add v2 API to list endpoints middleware" 2014-07-22 23:33:57 +00:00
ppalucki
05121f533a typo tradeoff -> trade-off
Change-Id: Iad5eb611bc727991606f8a2d4dbb08dcc8fa3ddb
2014-07-22 23:49:32 +02:00
Jenkins
2ef2d9b396 Merge "Add X-Delete-At/After support to FormPost" 2014-07-22 16:36:55 +00:00
Samuel Merritt
02aaabba6a Fix a couple small things in formpost doc string
Change-Id: Idb8d4707180396662493aacbd1f125c4ca43a1ca
2014-07-21 11:37:57 -07:00
Michael Barton
b908a65649 lock_file race fixes
I attempted to use this function and found a few problems.

We shouldn’t unlink the file after closing it, because someone else could lock
it in between.  Switch to unlink before close.

If someone else locked the file between our open and flock, they are likely to
unlink it out from underneath us.  Then we have a lock on a file that no longer
exists.  So stat the filename after locking to make sure the inode hasn't
changed or gone away.

We probably shouldn’t unlink the file if we time out waiting for a lock.  So
move that to before the finally block.

Change-Id: Id1858c97805d3ab81c584eaee8ce0d43d34a8089
2014-07-21 08:49:27 +00:00
Matthew Oliver
90272a0564 Add X-Delete-At/After support to FormPost
This change adds the ability to specify a X-Delete-At or
X-Delete-After attribute when using the FormPost middleware.

Here is an example of what you need to add to the form:

  <input type="hidden" name="x_delete_at" value="<unix-timestamp>"/>
  <input type="hidden" name="x_delete_after" value="<seconds>"/>

To be inline with the other form imput names, x-delete-at/after has
changed to x_delete_at/after.

DocImpact
Change-Id: Ib1cc0bcf1dd7d2b689f2f26d100f9bab36880c81
Closes-Bug: #1065522
2014-07-18 15:41:21 -07:00
paul luse
116ac459a6 Fix small typo in deployment guide
Change-Id: Ifd86ce5b36c2588b57fd44c633b095d1f49fcd5b
2014-07-18 14:35:49 -07:00
Clay Gerrard
216aaab638 Add v2 API to list endpoints middleware
The new API adds better support for storage policies and changes the
response from a list of backend urls to a dictionary with a key
"endpoints" that's a list of of the backend urls and a new key headers
that's a dictionary of headers to send along with the backend request.
In the v2 response format for object requests, there the headers key
includes "X-Backend-Storage-Policy-Index" which indicates the storage
policy index for the endpoints returned in the response.

Change-Id: I706a5b5be8002c633fe97b2429256735800a902e
2014-07-17 11:48:27 +01:00
Jenkins
dbc2102652 Merge "Disable case-changing behavior in Eventlet" 2014-07-17 01:02:31 +00:00
Jenkins
8aefe579b4 Merge "Object services user-agent string uses full name" 2014-07-16 21:09:03 +00:00
Jenkins
7605dc622b Merge "Container PUT requests and max container per account" 2014-07-16 20:38:34 +00:00
Jenkins
82f4610ff7 Merge "clean up saio env. after runnning func tests" 2014-07-16 19:20:15 +00:00
Jenkins
9fdd86bf44 Merge "Handle func tests of swift cluster that hide /info" 2014-07-11 19:47:28 +00:00
Jenkins
7132a539d0 Merge "Add filename*= support to tempurl Content-Disposition" 2014-07-11 19:47:11 +00:00
Jenkins
3a723e2c22 Merge "added process pid to the end of storage node log lines" 2014-07-11 19:45:57 +00:00
Thiago da Silva
e5d90a9cc3 clean up saio env. after runnning func tests
Added call to delete container in teardown_package().
Tests are leaving objects and containers in saio environment
after finishing running the tests.

Currently, delete_containers() is called in the setUp of each test
class, which cleans up the containers of the previous test,
but leaves the containers of the last test in the saio environment.

Change-Id: I643d7083a2a310fc3d24eab48c565f3798cff25f
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-11 14:25:37 -04:00
Peter Portante
0753dd3923 Handle func tests of swift cluster that hide /info
If a swift cluster configures the proxy server to not accept
/info requests, just do the best we can, skipping tests as
necessary.

To that end, if cors mode is not known we also skip the test.

Change-Id: I34f296c8717e0baf24ae552a7e38f9354ee91974
2014-07-11 10:05:53 -07:00
Gil Vernik
e5d76e9f05 Container PUT requests and max container per account
If container counter per account is equal or greater than
max_container_per_account, then all PUT requests are failed and
403 is returned.
This is correct behaviour if the request is to create a new
container, however if container already exists PUT should be
allowed, even the max_container_per_account condition has met.

This patch allows to process PUT requests for existing containers,
even if max_container_per_account > = container count.

It indirectly resolve the bug 1306711, since swift-client
uses internally PUT requests for container, prior it upload an
object there.

Change-Id: I2dcf20b6feb27e346111466a565695eba4b4b1da
2014-07-11 12:56:10 +03:00
paul luse
7ea30df9cd Update docs to highlight that the auditor chunk size can be set
May not be obvious, but existing code will let you change the
disk_chunk_size just for the auditor so this just points that
out in the docs.  In one short test I ran with a 4 node cluster
with 18GB of 4MB objects on it, changint he auditor chunk size
from the default of 64K to 1MB creased the auditor CPU time from
10% to 4%.

Also added test code to make sure this overridden value is
actually used and checked other auditWorker conf values as
well.

Change-Id: Ia12e1c6127877dc2124b60cd963cd0b6d5f3d6ef
2014-07-10 14:13:27 -07:00
Jenkins
ea61632e1f Merge "Adjust timeout value in test_client_timeout" 2014-07-10 20:45:58 +00:00
Jenkins
fecea64452 Merge "Fix the section name in CONTRIBUTING.rst" 2014-07-09 23:41:12 +00:00
John Dickinson
7ab2afe5bd added process pid to the end of storage node log lines
Change-Id: I1c2709d85575fc7d4868fafd9ee757fd01868436
2014-07-09 12:12:33 -07:00
John Dickinson
03a40b514a Merge tag '2.0.0'
Swift 2.0.0 release

Change-Id: I5fdc1e7434bdf6d88c4b260798791ee59f0832c0
2014-07-08 16:30:37 -07:00
Jenkins
b7def1c5c3 Merge "This setting should've been set to False back ..." 2014-07-08 17:42:13 +00:00
gholt
0582db728f This setting should've been set to False back ...
...with commit 9eb797b09916574c2a4e0f5f9ea61fe120879075

With this setting to True in the code, any tools anyone writes will
automatically start preallocating, which is almost always bad these days
with SSDs. So, if you write a tool that just scan dbs for stats, it'll
commit any pending info triggering preallocation and bam, your SSDs
start to fill up. :/

Anyway, back when I wrote 9eb797b09916574c2a4e0f5f9ea61fe120879075 it
was my intention to have this off by default, everywhere; I changed all
the settings points but I failed to change the dang constant itself.
This corrects that.

Change-Id: Iada0a3f1ecfabda4a96f574903d8e2eed1f69064
2014-07-08 15:15:07 +00:00
YummyBian
2f45600c7d Document the unnecessary method invoking in FakeRing
Add comment to explain why we invoke the get_part method even if the
_part_shift is equal to 32.

Closes-Bug:  #1335581

Change-Id: I160e9383b5e65f75ed5e89511cc7e63c51958a25
2014-07-08 11:55:13 +00:00
Jenkins
c94779d2ac Merge "Parallel object auditor" 2014-07-08 10:58:36 +00:00
Jenkins
c02371c2b4 Merge "Use except x as y instead of except x, y" 2014-07-08 10:22:20 +00:00
Jenkins
d303a861b3 Merge "Sync netifaces with global-requirements" 2014-07-08 01:54:27 +00:00
Christian Berendt
f6ff06b678 Use except x as y instead of except x, y
According to https://docs.python.org/3/howto/pyporting.html the
syntax changed in Python 3.x. The new syntax is usable with
Python >= 2.6 and should be preferred to be compatible with Python3.

Enabled hacking check H231.

Change-Id: I2c41dc3ec83e79181e8fd50e76771a74c393269c
2014-07-07 15:42:13 -07:00
Paul Luse
9150fb383e Adjust timeout value in test_client_timeout
Per information filed in bug (and related bugs referenced in the
report) it appears that in TestObjectController.test_client_timeout
having a matching timeout value for both self.app.client_timeout
and SlowBody() appears to work however, as expected, a smaller
value in self.app.client_timeout also works where a larger
value fails.  With that short test combined with speculation and
related fixes, seems reasonable to merge what is suggested in
the bug report, drop the self.app.client_timeout to 0.05

Fixes Bug #1316716

Change-Id: Ib4c6d3bb275f6c50c62505c90656efa7ee566bc0
2014-07-04 06:08:53 -07:00
Jenkins
0af4f035e2 Merge "Mock time for audit test 'test_sleeper'" 2014-07-04 02:52:43 +00:00
Jenkins
3fda874801 Merge "Fix issues with test_wsgi.py and Storage Policies" 2014-07-04 02:08:12 +00:00
Jenkins
f43050d242 Merge "Fix exception raising in FakeConn" 2014-07-03 11:42:47 +00:00
Paul Luse
bfa9139649 Fix potential missing key error in container_info
If upgrading from a non-storage policy enabled version of
swift to a storage policy enabled version its possible that
memcached will have an info structure that does not contain
the 'storage_policy" key resulting in an unhandled exception
during the lookup.  The fix is to simply make sure we never
return the dict without a storage_policy key defined; if it
doesn't exist its safe to make it '0' as this means you're
in the update scenario and there's xno other possibility.

Change-Id: If8c88f67ba7a3180ad06b586372fe35c65807aac
2014-07-02 21:18:10 -07:00
Clay Gerrard
7dbf832456 Fix pop_queue for move object twice
With the two vector timestamp change some resolution was lost in the queue
entries that could lead to the reconciler being unable to successfully remove
a processed item from the queue in pop_queue.  To ensure the queue entries
with a significant offset can be successfully removed while still handling
the re-enqueued object case issue the DELETE with the timestamp slightly later
than the maximum of the queue entries last modified time (q_record) and
misplaced objects timestamp (q_ts).

Change-Id: I87b1e4b4256af3f71defb58c8137c303d1ae63be
2014-07-02 21:18:05 -07:00
Clay Gerrard
fb5a0f21dd Fix KeyError on Storage Policy Container Sync
In the proxy, container_info can return a 'storage_policy' of None.  When
you set a header value on a swob.Request to None that effectively just
delete's the key.  One path through the proxy during container sync was
counting on the the 'X-Backend-Storage-Policy-Index' being set which isn't
the case if the cached container_info if for a pre-policies container.

Also clean up some test cruft, tighten up the interface on FakeConn, and add
some object controller tests to exercise more interesting failure and handoff
code paths.

Change-Id: I643e08c208efdc5a39e840d9e96710ddad54236b
2014-07-02 21:18:01 -07:00
Jenkins
8a4398ad47 Merge "Small cleanup to ring serialization" 2014-07-03 03:40:26 +00:00
Jenkins
240eab1cb0 Merge "Fix potential missing key error in container_info" 2014-07-03 03:40:23 +00:00
Jenkins
e39705ee56 Merge "Fix pop_queue for move object twice" 2014-07-03 02:11:22 +00:00
Steven Lang
7573fbd498 Object services user-agent string uses full name
It does not appear that, aside from the user-agent string, the strings
"obj-server", "obj-updater", or "obj-replicator" (or "obj-<anything>"*)
appear in the swift code base, aside from the directory containing the
object services code being named "obj".

Furthermore, the container, account, and proxy services construct their
user-agent string, as reported in the logs, using their full name. In
addition, this full name also shows up as the name of the process via
"ps" or "top", etc., which can make it easier for admins to match log
entries with other tools.

For consistency, we update the object services to use an "object-"
prefix rather than "obj-" in its user agent string.

* obj-etag does appear in a unit test, but not part of the regular
code.

Change-Id: I914fc189514207df2535731eda10cb4b3d30cc6c
2014-07-02 18:35:49 -07:00
Paul Luse
0800668557 Fix potential missing key error in container_info
If upgrading from a non-storage policy enabled version of
swift to a storage policy enabled version its possible that
memcached will have an info structure that does not contain
the 'storage_policy" key resulting in an unhandled exception
during the lookup.  The fix is to simply make sure we never
return the dict without a storage_policy key defined; if it
doesn't exist its safe to make it '0' as this means you're
in the update scenario and there's xno other possibility.

Change-Id: If8e8f66d32819c5bfb2d1308e14643f3600ea6e9
2014-07-02 15:58:22 -07:00