This is to remove the unncessary slash when the line doesn't
exceed the length of 79, to make the code more readable.
Change-Id: I31070067913560d6147f95d0fdfba4f9f9ce0936
Mostly this ammounts to
Exception.message -> Exception.args[0]
'...' -> b'...'
StringIO -> BytesIO
makefile() -> makefile('rwb')
iter.next() -> next(iter)
bytes[n] -> bytes[n:n + 1]
integer division
Note that the versioning tests are mostly untouched; they seemed to get
a little hairy.
Change-Id: I167b5375e7ed39d4abecf0653f84834ea7dac635
We've seen a noteworthy (literally -- there's a comment about it) number
of failures for test_multiphase_put_drains_extra_commit_junk_disconnect;
I'd rather waste an extra few hundredths of a second every run than have
to recheck most patches we want merged.
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Change-Id: Iebec6c18866e4f8ef40faab539b173f017d658e3
To prepare for object-expirer's general task queue feature [1],
this patch enables to configure object-expirer in object-server.conf.
Object-expirer.conf can be used in the same manner as before, but deprecated.
If both of object-server.conf with "object-expirer" section and
object-expirer.conf are in a node, only object-server.conf is used.
Object-expirer.conf is used only if all object-server.conf doesn't have
"object-expirer" section.
There are two differences between "object-expirer.conf" style and
"object-server.conf" style.
The first difference is `dequeue_from_legacy` default value.
`dequeue_from_legacy` defines task queue mode. In "object-expirer.conf"
style, the default mode is legacy queue. In "object-server.conf" style,
the default mode is general queue. But general mode means no-op mode
for now, because general task queue is not implemented yet.
The second difference is internal client config. In "object-expirer.conf"
style, config file of internal client is the object-expirer.conf itself.
In "object-server.conf" style, config file of internal client is
another file.
[1]: https://review.openstack.org/#/c/517389/
Co-Authored-By: Matthew Oliver <matt@oliver.net.au>
Change-Id: Ib21568f9b9d8547da87a99d65ae73a550e9c3230
More-recent versions of stestr are rather picky about wanting an integer
for concurrency [1], but ostestr prior to [2] defaults it to None. As a
result, all our func tests would fail with:
TypeError: int() argument must be a string or a number, not 'NoneType'
Also, move the rolling upgrade job to non-voting since it's going to
pull in the old version but try to run with new deps.
[1] https://github.com/mtreinish/stestr/commit/c93bc81
[2] https://review.openstack.org/#/c/651275/
Change-Id: Icba6c46bcff0e0516107e0f6742d32c92488ae20
Add the log_msg_template option in proxy-server.conf and log_format in
a/c/o-server.conf. It is a string parsable by Python's format()
function. Some fields containing user data might be anonymized by using
log_anonymization_method and log_anonymization_salt.
Change-Id: I29e30ef45fe3f8a026e7897127ffae08a6a80cd9
Drive-by: When passing a list or tuple to swob.Response as an app_iter,
check that it's full of byte strings.
Change-Id: Ifc35aacb2e45004f74c871f08ff3c52bc57c1463
There's a bug in CPython [1] that causes servers to mis-parse request
lines that include the bytes \x85 or \xa0. Naturally, we have
functional tests that (with high probability) will send such request
lines. There's a fix proposed, but the earliest it's likely to land
would be for 3.8, and we need to be able to target an earlier Python.
So, intercept the request line immediately before parsing and re-write
it to be RFC-compliant. Note that this is done for Python 2 as well,
though there should be no change in the request environment that
eventlet eventually hands to us.
[1] https://bugs.python.org/issue33973
Change-Id: Ie648f5c04d4415f3b620fb196fa567ce7575d522
There are some processes which don't pass their logger instances
when creating AccountBrokers/ContainerBrokers, which causes some
error messages with a different setting from the other logs
generated by the processes.
This patch makes them pass logger instances, to make sure they
generate all logs according to their log settings.
Change-Id: I914c3a2811e1a2b7f19ad2bc9b3d042fcba63820
Add a test assertion for invalid ETag of MPU manifest and make some
global constants more obvious.
Change-Id: I830c0d2e473d1740f9138ebc6efd64a39d85d1dc
Related-Change-Id: I7df13e670f702a2956a9c8057fcb971f4bfb7319
We don't actually need so many py2/py3 branches, and once we
clean those up, there's hardly any reason to import six.
Change-Id: Ia3b4f02e7eb99ad1a76aa35c39dc198528fd39ad
Looking at https://governance.openstack.org/tc/reference/runtimes/train.html
OpenStack is no longer targetting Python 3.5, so it doesn't really make sense
to gate on it. Move to Python 3.7, just to make it so we can go longer before
having to do this shuffle again.
Presumably, once we actually declare support for Python 3.6, we should
make that job voting, too? We've had enough gate flaky-ness lately that
I'm not keen on it.
Change-Id: I9c9e5df76a6592ab9c512b7c1ba807f9a0053059
It has not been necessary since we dropped support for Python 2.6.
See https://github.com/python/cpython/commit/8c6d9d7 and
https://bugs.python.org/issue2987.
Be sure to keep a `urlparse` name in utils, though; swauth (at least)
still expects there to be a swift.common.utils.urlparse.
Change-Id: If2502868f251b8a83aa929ee22b10046e708d111
An earlier revision of the related change had a bug that this test would
have discovered.
Related-Change-Id: I85dcaf65b9f19ac4659fa5937f9b0b0e804fc54e
Change-Id: Iedd85ec65a11de189ce73e650d674aee0dc7e402