Fix DB locked error on commit

This bug was introduced in ef7f9e27; while moving timeout for execute
to the cursor wrapper, commit was moved as well; however commit is
purely a connection method, only execute is passed on to a cursor.
Added unit tests to check both methods for correct timeouts.

This manifested in a test failure as:
ERROR __call__ error with POST /sdb1/418/AUTH_d1c4b610b16a48de83219c696261009c/TestContainer-tempest-1572414684 :
Traceback (most recent call last):
  File "/opt/stack/new/swift/swift/container/server.py", line 486, in __call__
    res = method(req)
  File "/opt/stack/new/swift/swift/common/utils.py", line 1915, in wrapped
    return func(*a, **kw)
  File "/opt/stack/new/swift/swift/common/utils.py", line 687, in _timing_stats
    resp = func(ctrl, *args, **kwargs)
  File "/opt/stack/new/swift/swift/container/server.py", line 464, in POST
    broker.update_metadata(metadata)
  File "/opt/stack/new/swift/swift/common/db.py", line 677, in update_metadata
    conn.commit()
OperationalError: database is locked (txn: tx5065394f288740e69fcec-00528e184e)

Change-Id: I269b133fac53d4792d21b62f801cc0c0ccf337ea
Fixed locale test in the presence of LANGUAGE

According to GNU documents, the priority order of language variables
is LANGUAGE, LC_ALL, LC_*, LANG. Therefore, if LANGUAGE is set, it
overrides the LC_ALL setting from the test. An empty value is ignored,
and setting it to empty is easier to deal with than just deleting the
variable.

Also fixed the Google translate fail esperanto grammar.

Fixes bug 1235058

Change-Id: Ic97b90dfc21997e19cc473250794a9b3c526beb5
add an "inline" query parameter to tempurl

Giving the inline query parameter will cause the tempurl
response to be given a "Content-Disposition: inline" header,
regardless of other query parameters or metadata. This allows
easy in-line viewing, eg in browsers.

DocImpact

Change-Id: Icd5c544d6a749d4f58e8a921968f4e432a2185db
Merge "Fix DB locked error on commit"
Handle optional arguments for run_forever()

All the other daemons do this, and since the out deamon wrapper
scripts pass all the command line options through directly, seems
simple enough to handle them by ignoring.

This is also applied to run_once().

Change-Id: I1df83bdf78f0dc3d911019f67f78301967b5da72
Closes-Bug: #1253891
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Simple fix for proxy-logging empty field handling

Change-Id: Ia135575bd30a0bc04a2105291e68a6d18c7a3047
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Remove obsolete future imports

The with statement has been standard since Python 2.5, so we can get
rid of these imports.

Change-Id: I280971c3d8c01e94cc2c17cacaedcbe9d9c8a3c3
Get retry.

If a source times out on read try another one of them with a
modified range.  There had to be a lot of moved around code
to get this working but it should all make sense.

Change-Id: Ieaf045690a8823927a6f38098a95b37a4d4adb70
Merge "Fixed locale test in the presence of LANGUAGE"
Per device replication_lock

New replication_one_per_device (True by default)
that restricts incoming REPLICATION requests to
one per device, replication_currency allowing.

Also has replication_lock_timeout (15 by default)
to control how long a request will wait to obtain
a replication device lock before giving up.

This should be very useful in that you can be
assured any concurrent REPLICATION requests are
each writing to distinct devices. If you have 100
devices on a server, you can set
replication_concurrency to 100 and be confident
that, even if 100 replication requests were
executing concurrently, they'd each be writing to
separate devices. Before, all 100 could end up
writing to the same device, bringing it to a
horrible crawl.

NOTE: This is only for ssync replication. The
current default rsync replication still has the
potentially horrible behavior.

Change-Id: I36e99a3d7e100699c76db6d3a4846514537ff685
Merge "Simple fix for proxy-logging empty field handling"
Merge "Get retry."
Merge "Remove obsolete future imports"
Merge "add an "inline" query parameter to tempurl"
Merge "Per device replication_lock"
Use a more portable errno in tests.

ELIBBAD doesn't exist on OS X. The exact value we use here isn't
important, so use something more portable.

Change-Id: Id03dc1773f416a94bbd14ad31b2b2a70f16b9a51