627d0ba52f8f04765e09c9fe0974a2308ee6def3
Commit Graph

2650 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
niu-zglinux
627d0ba52f Rename requires files to standard names.
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files, and tools in the
general world are growing intelligence about them.
Change-Id: Ib3e50a811868e2969923d978ee00c4f92682aa1c
Fixes: bug #1179008 
2013年05月30日 22:14:01 +00:00
Jenkins
5501a4031f Merge "Handle DB creation race condition" 2013年05月30日 20:27:22 +00:00
Jenkins
ad98ca0ede Merge "Move parameter checking before disk accesses" 2013年05月30日 20:24:25 +00:00
Jenkins
00f5d327ca Merge "Subtle change to tempurl content-disposition names" 2013年05月30日 19:18:10 +00:00
Samuel Merritt
2c9aee55fb In TempURL, cache "no keys" for a shorter time.
In other places in the codebase, we cache a negative result for less
time (usually a tenth) than we cache a positive result. This commit
makes TempURL do the same.
This creates a slightly nicer experience for someone trying to set up
TempURL; if they get the initial key setup wrong, try it, then fix it,
it now takes only 6 seconds until they can use signed URLs, not
60. That's a short enough time that they may not even notice the
caching of no keys.
Change-Id: I521f023e7cddaecd07f0ce32aedd4059bd0b8ec4
2013年05月29日 21:19:32 -07:00
gholt
8d681f0618 Subtle change to tempurl content-disposition names
If an object name ends with a /, the content-disposition filename for
a tempurl ended up as an empty string. This fix just strips any
trailing slashes before calling basename.
Also, I added a test to verify that if the filename is passed as an
overriding query parameter, that it is used in full, no rstripping,
no basenaming.
Change-Id: I37725b6ded04ed3b91cdb21132490fd857276e2f
2013年05月29日 15:06:25 +00:00
Peter Portante
8d6869a6cc Move parameter checking before disk accesses
For HEAD and GET requests on both containers and accounts APIs we now
perform parameter checking before we access the database. The unit
tests were updated to show that the parameter checking is performed
before accesses are performed.
Change-Id: Ieb753316cdccabf45022e3d83522d87d34aa6b0e
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年05月29日 00:48:53 -04:00
Jenkins
a2db3b6f32 Merge "RingBuilder.add_dev returns device id" 2013年05月29日 00:10:22 +00:00
Alex Gaynor
b147c9e221 Made tests use a JSON parser in liue of eval.
The results that are being parsed are really JSON, so using a JSON parser is
more semantically correct; in addition using eval anywhere can set a bad
example.
Change-Id: Idcd55400b2571aba0f2f377cf66a3cbf4d3af960
2013年05月28日 07:26:46 -07:00
Jenkins
1b283d47cd Merge "Retrieve the swift version with recon" 2013年05月25日 00:23:30 +00:00
David Hadas
9745a28b18 Handle DB creation race condition
Till now if a race occurs on a request to a DB when it is
first created, the loosing party die with 500...
... and an error stating a race is in the log file.
Both removed by simply accepting the fact that the DB is in fact
created by someone else - just less work for us to do... ;)
Fixes Bug #1051998
Change-Id: I8e29bf362edf2b1a84f9bffa39c04d5b3dc241b2
2013年05月24日 19:26:10 +00:00
Ilya Kharin
3957dbc5d4 RingBuilder.add_dev returns device id
When added a new devices into builder the add_dev function returns it
unique id.
blueprint argparse-in-swift-ring-builder
Change-Id: I57080bb625e812f6cea71199df907a44b332b552
2013年05月24日 17:34:24 +04:00
Ilya Kharin
43bf568f48 Move parse search logic outside from builder
Dramatic part of RingBuilder.search_devs which parse a complex format
of a search device string moved to the swift-ring-builder script.
Instead, the search_devs has a simple interface to search devices.
blueprint argparse-in-swift-ring-builder
Change-Id: If3dd77b297b474fb9a058e4693fef2dfb11fca3d
2013年05月24日 17:12:34 +04:00
Jenkins
f57628a4ae Merge "Fixed probetests" 2013年05月24日 01:05:35 +00:00
Chuck Thier
7a02c218bb Fixed probetests
* Fixed issue with running probetests with the latest update
 of python-swiftclient that removed eventlet
* Fixed issue with replication server tests to not require hard
 coded paths
Change-Id: Ibbf727ae99c0f3893ae58e270e2f879a1f618e49
2013年05月23日 22:41:04 +00:00
gholt
1c8d188872 Put some comments in places we get asked about a lot
Change-Id: If932b82f4e225cfdda21f47e4215c6f4c59dae4a
2013年05月23日 20:06:28 +00:00
Marcelo Martins
7fbb97b39e Retrieve the swift version with recon
Adding a '/recon/version' in order to get the swift version
Change-Id: I7b7ddbe70abb87c6a3b1010ddefa09d0acc09710
2013年05月23日 15:06:12 -05:00
Jenkins
b4b35c2561 Merge "Fix problem with changing class attribute" 2013年05月23日 09:18:28 +00:00
Jenkins
dacdbe99e7 Merge "account-reaper warns if not making progress" 2013年05月22日 23:40:46 +00:00
Peter Portante
d0a27f477b Hide the file descriptor and disk write methodology for PUTs
Towards moving the DiskFile class into place as the API definition for
pluggable DiskFile backends, we hide the file descriptor and the
method of writing data to disks. The mkstemp() method has been renamed
to writer(), and no longer returns an fd, but a new object that
encapsulates the state tracked for writes. This new object is then
used directly to perform the reminder of the write operations and
application of required semantics.
Change-Id: Ib37ed37b34a2ce6b442d69f83ca011c918114434
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年05月22日 16:01:22 +00:00
Donagh McCabe
34e2ab3f31 account-reaper warns if not making progress
DocImpact
If account reaper has not managed to clean out an account after a long
period, it prints a message to the log (you can search your system looking
for such messages). Introduce reap_warn_after config variable to determine
when to emit the message (defaults to 30 days).
Also fix bug 1181995 (edge case where object name is an empty string)
Change-Id: Ic0dfee04742d06b6a51b59f302d7a272d7c1de92
2013年05月22日 15:07:17 +01:00
Jenkins
6b4cba8371 Merge "close socket on exceptions" 2013年05月22日 13:12:14 +00:00
Samuel Merritt
bd3ca778d1 Fix ValueError from handoff logging.
If you have StatsD logging turned on, then the iterator returned by
Ring.get_part_nodes() will emit StatsD packets when it yields a
handoff node. That network IO may make eventlet trampoline to another
greenthread before returning from next(). Now, if that other
greenthread tries to call next() on that same iterator, it blows up
with a ValueError.
Any socket IO inside a generator's next() method can cause this. It's
easiest to reproduce with StatsD logging turned on, but logging to
syslog can trigger it too.
You can see this happen sometimes in the proxy's make_requests method
if two of the primary nodes are down. Greenthread A goes into next()
to get a handoff node, then sends a StatsD packet, and so eventlet
trampolines to Greenthread B. Now, Greenthread B also calls next() to
get a handoff node, and dies with a ValueError.
This commit wraps up concurrently-accessed iter_nodes() iterators in a
new thing called a GreenthreadSafeIterator that serializes access.
Bug 1180110
Change-Id: I8fe13d7295c056a2cab9e084f5966078a49bdc13
2013年05月21日 13:19:38 -07:00
Vladimir Vechkanov
fd3b64bb16 Fix problem with changing class attribute
Attribute get_repl_missing_table in FakeBroker class was changed in
test_replicate_object_quarantine function and not returned back. That's
why next test cases takes not expexted values from FakeBroker.
fixes bug 1180354
Change-Id: Iba55255771e6483832c7782fcbe331e20e818f4e
2013年05月21日 23:21:50 +04:00
David Goetz
f85cf2b827 close socket on exceptions
Change-Id: I0dee7c109d32e6325845df9ba6e1fbf23a2d1b89
2013年05月21日 10:59:44 -07:00
Jenkins
deb01b840d Merge "Add unit tests to ensure TZ variable remains set" 2013年05月21日 14:58:16 +00:00
Jenkins
af8b6e1d74 Merge "Move common code into a separate function." 2013年05月21日 07:00:37 +00:00
Jenkins
4a1f3d3e1a Merge "Add ability to save builder data to a disk file" 2013年05月21日 06:13:46 +00:00
Peter Portante
eb658a1034 Add unit tests to ensure TZ variable remains set
See review https://review.openstack.org/29836.
Change-Id: I8ec80202789707f723abfe93ccc9cf1e677e4dc6
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年05月20日 22:31:03 -04:00
Jenkins
7bc9b0cb15 Merge "Set TZ environment variable to avoid a stat call" 2013年05月21日 01:04:44 +00:00
Jenkins
53f3c61adf Merge "Fix two documentation warnings." 2013年05月21日 01:04:41 +00:00
Jenkins
d1f1e9fb67 Merge "Don't delete containers when they weren't created." 2013年05月21日 01:04:38 +00:00
Peter Portante
306c7549ec Set TZ environment variable to avoid a stat call
By setting the TZ environment variable for the WSGI process we avoid
the stat("/etc/localtime") on every request handled that logs using
strftime().
Change-Id: Ifc78236a99ed193a42389e383d062b38f57a5a31
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年05月20日 17:29:20 -04:00
Shri Javadekar
6acac14aaf Move common code into a separate function.
test_get_valid and test_get_valid_key2 test tempurl with a
single key and two keys respectively. This change moves common code
for these tests into a separate function.
Change-Id: Ifee211285e27df03d041a4c357b7c1f0c96ed6a8
2013年05月17日 09:54:52 -07:00
gholt
69cf78bb16 Moved tests for moved obj.base code
Follow-on to https://review.openstack.org/#/c/28895/
Moved the tests for the code that was moved to obj.base and also made
the new test file flake8 compliant.
Change-Id: I4be718927b6cd2de8efe32f8e54b458a4e05291b
2013年05月17日 14:27:13 +00:00
Jenkins
d754b59cf8 Merge "Moved some code out of swift.obj.replicator" 2013年05月17日 04:47:21 +00:00
Jenkins
b358a5cc2c Merge "Autocreate cleanups" 2013年05月17日 04:26:37 +00:00
Jenkins
7d765bb347 Merge "Remove dead code." 2013年05月16日 23:09:56 +00:00
David Hadas
fd3acd2e59 Autocreate cleanups
Autocreate was messy - now cleaned.
Auto-create now occurs at account POST, and container PUT only.
A method for autocreation was added
Autocreation was removed from account_info and container_info.
Fake-it as if the account exists on account HEAD and account GET.
Return 404 on everything else when the account does not exist.
Fix: Bug #1172223
Fix: Bug #1179140
Change-Id: Iac54c1438eb09883fbc29a1ad2ac2245b95efc92
2013年05月16日 20:54:05 +03:00
Ilya Kharin
cc040a9c29 Add ability to save builder data to a disk file
Instances of the RingBuilder class can store its data to a disk file by
the save method and load it by the load method.
blueprint argparse-in-swift-ring-builder
Change-Id: I69fdf0693ca9f520d235a795ecdd2da310dcd5d3
2013年05月16日 19:49:00 +04:00
Jenkins
678a3ae832 Merge "Skip IPv6 addresses in cname_lookup middleware." 2013年05月16日 12:48:35 +00:00
Jenkins
d85e090a14 Merge "Metadata retrieving from sqlite must be str for key" 2013年05月16日 12:37:33 +00:00
Jenkins
959f5e7ea8 Merge "Implementation of replication servers" 2013年05月16日 02:43:49 +00:00
Samuel Merritt
dc10d9993b Remove dead code.
While it is true that one *could* call ContainerBroker.get_info() with
include_metadata=True, it is also true that nobody actually does.
It's also true that the code path taken when include_metadata=True is
broken in the case of non-ASCII metadata keys
(e.g. X-Container-Meta-☃: snowman), so leaving it around is just
asking for future pain.
Change-Id: I4931add4b8fb7c4f57820e52f182c21040d8db10
2013年05月15日 16:53:17 -07:00
Jenkins
50157243dd Merge "Refactor Bulk middleware to handle long running requests" 2013年05月15日 23:14:15 +00:00
Fabien Boucher
e7ce290904 Metadata retrieving from sqlite must be str for key
Encode metadata key as utf8 if key is unicode when
retriving it from sqlite database.
Change-Id: I4ba11543d1bed17098b5e52dd768c75b403188a1
Fixes: bug #1172202 
2013年05月15日 17:04:03 +02:00
Peter Portante
81623cfa2c Perform mount check after REST params valid on PUT
All the other methods (POST, GET, HEAD, DELETE and REPLICATE) first
validate the REST parameters and headers before performing the mount
check. Do the same for PUT.
Change-Id: I6e5f34cc65b57662b7f88224ca0e1501787e0f43
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年05月14日 12:07:21 -04:00
Jenkins
884b7bb8f8 Merge "Fix obscure double url bug in container quota middleware" 2013年05月13日 20:28:05 +00:00
Greg Lange
597072cc95 Fix obscure double url bug in container quota middleware
With the container quota middleware on, if you made a request similar to the
following one you'd get a 500 response.
curl -i -X PUT -H 'X-Auth-Token: token'
http://127.0.0.1:8080/v1/AUTH_testhttp://something/something_else
(Note the double url.)
This was due to a mismatch in how split_path() was called in the middleware and
in the get_container_info().
This change fixes that mismatch and the bug.
Change-Id: Ie42ab585b942b7201e13b02a0c706532952aac60
2013年05月13日 19:17:31 +00:00
Peter Portante
8825c9c74a Enhance log msg to report referer and user-agent
Enhance internally logged messages to report referer and user-agent.
Pass the referering URL and METHOD between internal servers (when
known), and set the user-agent to be the server type (obj-server,
container-server, proxy-server, obj-updater, obj-replicator,
container-updater, direct-client, etc.) with the process PID. In
conjunction with the transaction ID, it helps to track down which PID
from a given system was responsible for initiating the request and
what that server was working on to make this request.
This has been helpful in tracking down interactions between object,
container and account servers.
We also take things a bit further performaing a bit of refactoring to
consolidate calls to transfer_headers() now that we have a helper
method for constructing them.
Finally we performed further changes to avoid header key duplication
due to string literal header key values and the various objects
representing headers for requests and responses. See below for more
details.
====
Header Keys
There seems to be a bit of a problem with the case of the various
string literals used for header keys and the interchangable way
standard Python dictionaries, HeaderKeyDict() and HeaderEnvironProxy()
objects are used.
If one is not careful, a header object of some sort (one that does not
normalize its keys, and that is not necessarily a dictionary) can be
constructed containing header keys which differ only by the case of
their string literals. E.g.:
 { 'x-trans-id': '1234', 'X-Trans-Id': '5678' }
Such an object, when passed to http_connect() will result in an
on-the-wire header where the key values are merged together, comma
separated, that looks something like:
 HTTP_X_TRANS_ID: 1234,5678
For some headers in some contexts, this is behavior is desirable. For
example, one can also use a list of tuples which enumerate the multiple
values a single header should have.
However, in almost all of the contexts used in the code base, this is
not desirable.
This behavior arises from a combination of factors:
 1. Header strings are not constants and different lower-case and
 title-case header strings values are used interchangably in the
 code at times
 It might be worth the effort to make a pass through the code to
 stop using string literals and use constants instead, but there
 are plusses and minuses to doing that, so this was not attempted
 in this effort
 2. HeaderEnvironProxy() objects report their keys in ".title()"
 case, but normalize all other key references to the form
 expected by the Request class's environ field
 swob.Request.headers fields are HeaderEnvironProxy() objects.
 3. HeaderKeyDict() objects report their keys in ".lower()" case,
 and normalize all other key references to ".lower()" case
 swob.Response.headers fields are HeaderKeyDict() objects.
Depending on which object is used and how it is used, one can end up
with such a mismatch.
This commit takes the following steps as a (PROPOSED) solution:
 1. Change HeaderKeyDict() to normalize using ".title()" case to
 match HeaderEnvironProxy()
 2. Replace standard python dictionary objects with HeaderKeyDict()
 objects where possible
 This gives us an object that normalizes key references to avoid
 fixing the code to normalize the string literals.
 3. Fix up a few places to use title case string literals to match
 the new defaults
Change-Id: Ied56a1df83ffac793ee85e796424d7d20f18f469
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年05月13日 17:39:02 +00:00