Have swift-init warn when the running user doesn't have permissions to
signal processes. Fixes bug 1017494.
Change-Id: Icb9048ab36f1ca73bb93b11c9c2aed882d99dfa7
This patch introduces a new user format to tempauth which starts with
"user64_" and in which the account and user are base64 encoded (sans
padding equal signs):
user64_<account_b64>_<user_b64> = <key> [group] [group] [...] [storage_url]
This allows unambiguous parsing and adds the ability to have a user or
account name containing underscores.
The handling of tempauth configuration is fully backward compatible and
this only adds new, optional functionality.
Also beefed up unit tests to get full coverage of the user parsing code
in tempauth's __init__().
Change-Id: Id06304934ab8055a28921f2e1aa3c58a2036d8f8
This change replaces WebOb with a mostly compatible local library,
swift.common.swob. Subtle changes to WebOb's API over the years have been a
huge headache. Swift doesn't even run on the current version.
There are a few incompatibilities to simplify the implementation/interface:
* It only implements the header properties we use. More can be easily added.
* Casts header values to str on assignment.
* Response classes ("HTTPNotFound") are no longer subclasses, but partials
on Response, so things like isinstance no longer work on them.
* Unlike newer webob versions, will never return unicode objects.
Change-Id: I76617a0903ee2286b25a821b3c935c86ff95233f
Abstracts fdatasync/fsync/fcntl into an FsyncWrapper to determine, the
first time it is used, which fsync-like call is supported on the host
platform:
- Linux: use fdatasync(fd) as Swift already does today.
- Darwin: use fcntl(fd, F_FULLFSYNC), since Darwin provides the
F_FULLFSYNC flag when you wish to fsync data you care about, ensuring
that it is written to disk and not simply a buffer.
- BSD/Other: use fsync for non-Darwin BSDs and as a fallback for other
platforms.
Change-Id: Ibcfdeef7843b2f10cf8a17a6b989038ea2364376
This fixes an issue where Request objects (and related objects) were
not getting garbage collected when a 499 (client disconnect) occurred
for responses that still would have had more than the proxy server's
client chunk size left to send.
Fixed bug #1055834
Change-Id: Ib7b5fffe970dcdec60b90a9bdcd67c49b68fb914
I think not doing this was setting the SIGPIPE handler to signal.SIG_DFL
instead of the Python default of signal.SIG_IGN. This could cause other
tests which make a client stop reading before all data "chunks" are read
to fail harder than they should (i.e. the SIGPIPE there is benign and
even expected--the other side of the socket really did get closed
early).
Change-Id: I946a1913714a34ec677b701a2b5724bc8b715f70
Catches an IOError that is thrown when starting Swift on BSD-based
platforms, as the underlying system call to flush returns errno 9 (bad
file descriptor), whereas on Linux it succeeds.
Change-Id: Ic143d2fe6c3e1e0b39794958b40b0f5efdc17c06
Resolves an issue preventing Swift from starting on BSD-based platforms
that do not have this TCP flag (FreeBSD, OSX/Darwin, OpenBSD); identical
to Glance bug 879195, change I2f062a34, Glance commit efcdac36
(originally reported and patched by Brian Waldon).
Change-Id: Ifd696fe1080464d060e608c075ad0c113baab5ab
Have builder.add_devs get the next id to use when adding a new device
if its not specified in the dict.
Change-Id: I5a0defab43f5cfc5d997080bfd8563bfe72368ad
On some systems (eg Illumos), posix_fallocate() returns
EINVAL when the underlying filesystem doesn't support the
operation. On Linux, the fallocate() call returns
EOPNOTSUPP.
The need for this patch was revealed by Victor Rodionov
<victor.rodionov@nexenta.com>.
Change-Id: I06fa9d49e7ec4084135843b7e0c91948dc098d27
This change refactors container_info to return a dict instead of a tuple
with 6 (and counting...) values.
Also adds container size to cached info.
Change-Id: If68a06ab170504fbf07323354f3d0e073850493d
Change previously hard-coded constants into config variables. This
allows deployers to tune their cluster more specifically based on
their needs. For example, a deployment that uses direct swift access
for public content may need to set a larger header value constraint to
allow for the full object name to be represented in the Content-
Disposition header (which browsers check to determine the name of a
downloaded object).
The new settings are set in the [swift-constraints] section of
/etc/swift/swift.conf. Comments were also added to this config file.
Cleaned up swift/common/constraints.py to pass pep8 1.3.3
Funtional tests now require constraints to be defined in /etc/test.conf or in
/etc/swift/swift.conf (in the case of running the functional tests against a
local swift cluster). To have any hope of tests passing, the defined
constraints must match the constraints on the tested cluster.
Removed a ton of "magic numbers" in both unit and functional tests.
Change-Id: Ie4588e052fd158314ddca6cd8fca9bc793311465