swift 2.31.1__py2.py3-none-any.whl → 2.32.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swift/cli/info.py +9 -2
- swift/cli/ringbuilder.py +5 -1
- swift/common/container_sync_realms.py +6 -7
- swift/common/daemon.py +7 -3
- swift/common/db.py +22 -7
- swift/common/db_replicator.py +19 -20
- swift/common/direct_client.py +63 -14
- swift/common/internal_client.py +24 -3
- swift/common/manager.py +43 -44
- swift/common/memcached.py +168 -74
- swift/common/middleware/__init__.py +4 -0
- swift/common/middleware/account_quotas.py +98 -40
- swift/common/middleware/backend_ratelimit.py +6 -4
- swift/common/middleware/crossdomain.py +21 -8
- swift/common/middleware/listing_formats.py +26 -38
- swift/common/middleware/proxy_logging.py +12 -9
- swift/common/middleware/s3api/controllers/bucket.py +8 -2
- swift/common/middleware/s3api/s3api.py +9 -4
- swift/common/middleware/s3api/s3request.py +32 -24
- swift/common/middleware/s3api/s3response.py +10 -1
- swift/common/middleware/tempauth.py +9 -10
- swift/common/middleware/versioned_writes/__init__.py +0 -3
- swift/common/middleware/versioned_writes/object_versioning.py +22 -5
- swift/common/middleware/x_profile/html_viewer.py +1 -1
- swift/common/middleware/xprofile.py +5 -0
- swift/common/request_helpers.py +1 -2
- swift/common/ring/ring.py +22 -19
- swift/common/swob.py +2 -1
- swift/common/{utils.py → utils/__init__.py} +610 -1146
- swift/common/utils/ipaddrs.py +256 -0
- swift/common/utils/libc.py +345 -0
- swift/common/utils/timestamp.py +399 -0
- swift/common/wsgi.py +70 -39
- swift/container/backend.py +106 -38
- swift/container/server.py +11 -2
- swift/container/sharder.py +34 -15
- swift/locale/de/LC_MESSAGES/swift.po +1 -320
- swift/locale/en_GB/LC_MESSAGES/swift.po +1 -347
- swift/locale/es/LC_MESSAGES/swift.po +1 -279
- swift/locale/fr/LC_MESSAGES/swift.po +1 -209
- swift/locale/it/LC_MESSAGES/swift.po +1 -207
- swift/locale/ja/LC_MESSAGES/swift.po +2 -278
- swift/locale/ko_KR/LC_MESSAGES/swift.po +3 -303
- swift/locale/pt_BR/LC_MESSAGES/swift.po +1 -204
- swift/locale/ru/LC_MESSAGES/swift.po +1 -203
- swift/locale/tr_TR/LC_MESSAGES/swift.po +1 -192
- swift/locale/zh_CN/LC_MESSAGES/swift.po +1 -192
- swift/locale/zh_TW/LC_MESSAGES/swift.po +1 -193
- swift/obj/diskfile.py +19 -6
- swift/obj/server.py +20 -6
- swift/obj/ssync_receiver.py +19 -9
- swift/obj/ssync_sender.py +10 -10
- swift/proxy/controllers/account.py +7 -7
- swift/proxy/controllers/base.py +374 -366
- swift/proxy/controllers/container.py +112 -53
- swift/proxy/controllers/obj.py +254 -390
- swift/proxy/server.py +3 -8
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-server +1 -1
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-server +1 -1
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-drive-audit +45 -14
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-server +1 -1
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-proxy-server +1 -1
- {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/AUTHORS +4 -0
- {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/METADATA +32 -35
- {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/RECORD +103 -100
- {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/WHEEL +1 -1
- {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/entry_points.txt +0 -1
- swift-2.32.1.dist-info/pbr.json +1 -0
- swift-2.31.1.dist-info/pbr.json +0 -1
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-audit +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-auditor +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-info +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-reaper +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-replicator +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-config +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-auditor +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-info +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-reconciler +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-replicator +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-sharder +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-sync +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-updater +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-dispersion-populate +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-dispersion-report +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-form-signature +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-get-nodes +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-init +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-auditor +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-expirer +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-info +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-reconstructor +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-relinker +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-replicator +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-updater +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-oldies +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-orphans +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-recon +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-recon-cron +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-reconciler-enqueue +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-builder +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-builder-analyzer +0 -0
- {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-composer +0 -0
- {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/LICENSE +0 -0
- {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/top_level.txt +0 -0
swift/obj/ssync_sender.py
CHANGED
@@ -21,6 +21,7 @@ from swift.common import bufferedhttp
|
|
21
21
|
from swift.common import exceptions
|
22
22
|
from swift.common import http
|
23
23
|
from swift.common import utils
|
24
|
+
from swift.common.swob import wsgi_to_bytes
|
24
25
|
|
25
26
|
|
26
27
|
def encode_missing(object_hash, ts_data, ts_meta=None, ts_ctype=None,
|
@@ -42,9 +43,13 @@ def encode_missing(object_hash, ts_data, ts_meta=None, ts_ctype=None,
|
|
42
43
|
if ts_meta and ts_meta != ts_data:
|
43
44
|
delta = ts_meta.raw - ts_data.raw
|
44
45
|
extra_parts.append('m:%x' % delta)
|
46
|
+
if ts_meta.offset:
|
47
|
+
extra_parts[-1] += '__%x' % ts_meta.offset
|
45
48
|
if ts_ctype and ts_ctype != ts_data:
|
46
49
|
delta = ts_ctype.raw - ts_data.raw
|
47
50
|
extra_parts.append('t:%x' % delta)
|
51
|
+
if ts_ctype.offset:
|
52
|
+
extra_parts[-1] += '__%x' % ts_ctype.offset
|
48
53
|
if 'durable' in kwargs and kwargs['durable'] is False:
|
49
54
|
# only send durable in the less common case that it is False
|
50
55
|
extra_parts.append('durable:%s' % kwargs['durable'])
|
@@ -262,7 +267,7 @@ class Sender(object):
|
|
262
267
|
self.daemon.node_timeout, 'connect receive'):
|
263
268
|
response = connection.getresponse()
|
264
269
|
if response.status != http.HTTP_OK:
|
265
|
-
err_msg = response.read()
|
270
|
+
err_msg = utils.cap_length(response.read(), 1024)
|
266
271
|
raise exceptions.ReplicationException(
|
267
272
|
'Expected status %s; got %s (%s)' %
|
268
273
|
(http.HTTP_OK, response.status, err_msg))
|
@@ -354,7 +359,7 @@ class Sender(object):
|
|
354
359
|
except UnicodeDecodeError:
|
355
360
|
pass
|
356
361
|
raise exceptions.ReplicationException(
|
357
|
-
'Unexpected response: %r' % line
|
362
|
+
'Unexpected response: %r' % utils.cap_length(line, 1024))
|
358
363
|
while True:
|
359
364
|
with exceptions.MessageTimeout(
|
360
365
|
self.daemon.http_timeout, 'missing_check line wait'):
|
@@ -443,7 +448,7 @@ class Sender(object):
|
|
443
448
|
except UnicodeDecodeError:
|
444
449
|
pass
|
445
450
|
raise exceptions.ReplicationException(
|
446
|
-
'Unexpected response: %r' % line
|
451
|
+
'Unexpected response: %r' % utils.cap_length(line, 1024))
|
447
452
|
while True:
|
448
453
|
with exceptions.MessageTimeout(
|
449
454
|
self.daemon.http_timeout, 'updates line wait'):
|
@@ -460,17 +465,12 @@ class Sender(object):
|
|
460
465
|
except UnicodeDecodeError:
|
461
466
|
pass
|
462
467
|
raise exceptions.ReplicationException(
|
463
|
-
'Unexpected response: %r' % line
|
468
|
+
'Unexpected response: %r' % utils.cap_length(line, 1024))
|
464
469
|
|
465
470
|
def send_subrequest(self, connection, method, url_path, headers, df):
|
466
471
|
msg = [b'%s %s' % (method.encode('ascii'), url_path.encode('utf8'))]
|
467
472
|
for key, value in sorted(headers.items()):
|
468
|
-
|
469
|
-
msg.append(b'%s: %s' % (key, value))
|
470
|
-
else:
|
471
|
-
msg.append(b'%s: %s' % (
|
472
|
-
key.encode('utf8', 'surrogateescape'),
|
473
|
-
str(value).encode('utf8', 'surrogateescape')))
|
473
|
+
msg.append(wsgi_to_bytes('%s: %s' % (key, value)))
|
474
474
|
msg = b'\r\n'.join(msg) + b'\r\n\r\n'
|
475
475
|
with exceptions.MessageTimeout(self.daemon.node_timeout,
|
476
476
|
'send_%s' % method.lower()):
|
@@ -21,7 +21,7 @@ from swift.common.utils import public
|
|
21
21
|
from swift.common.constraints import check_metadata
|
22
22
|
from swift.common.http import HTTP_NOT_FOUND, HTTP_GONE
|
23
23
|
from swift.proxy.controllers.base import Controller, clear_info_cache, \
|
24
|
-
set_info_cache
|
24
|
+
set_info_cache, NodeIter
|
25
25
|
from swift.common.middleware import listing_formats
|
26
26
|
from swift.common.swob import HTTPBadRequest, HTTPMethodNotAllowed
|
27
27
|
from swift.common.request_helpers import get_sys_meta_prefix
|
@@ -63,8 +63,8 @@ class AccountController(Controller):
|
|
63
63
|
partition = self.app.account_ring.get_part(self.account_name)
|
64
64
|
concurrency = self.app.account_ring.replica_count \
|
65
65
|
if self.app.get_policy_options(None).concurrent_gets else 1
|
66
|
-
node_iter = self.app
|
67
|
-
|
66
|
+
node_iter = NodeIter(self.app, self.app.account_ring, partition,
|
67
|
+
self.logger, req)
|
68
68
|
params = req.params
|
69
69
|
params['format'] = 'json'
|
70
70
|
req.params = params
|
@@ -96,7 +96,7 @@ class AccountController(Controller):
|
|
96
96
|
# up-to-date information for the account.
|
97
97
|
resp.headers['X-Backend-Recheck-Account-Existence'] = str(
|
98
98
|
self.app.recheck_account_existence)
|
99
|
-
set_info_cache(
|
99
|
+
set_info_cache(req.environ, self.account_name, None, resp)
|
100
100
|
|
101
101
|
if req.environ.get('swift_owner'):
|
102
102
|
self.add_acls_from_sys_metadata(resp)
|
@@ -124,7 +124,7 @@ class AccountController(Controller):
|
|
124
124
|
account_partition, accounts = \
|
125
125
|
self.app.account_ring.get_nodes(self.account_name)
|
126
126
|
headers = self.generate_request_headers(req, transfer=True)
|
127
|
-
clear_info_cache(
|
127
|
+
clear_info_cache(req.environ, self.account_name)
|
128
128
|
resp = self.make_requests(
|
129
129
|
req, self.app.account_ring, account_partition, 'PUT',
|
130
130
|
req.swift_entity_path, [headers] * len(accounts))
|
@@ -146,7 +146,7 @@ class AccountController(Controller):
|
|
146
146
|
account_partition, accounts = \
|
147
147
|
self.app.account_ring.get_nodes(self.account_name)
|
148
148
|
headers = self.generate_request_headers(req, transfer=True)
|
149
|
-
clear_info_cache(
|
149
|
+
clear_info_cache(req.environ, self.account_name)
|
150
150
|
resp = self.make_requests(
|
151
151
|
req, self.app.account_ring, account_partition, 'POST',
|
152
152
|
req.swift_entity_path, [headers] * len(accounts))
|
@@ -173,7 +173,7 @@ class AccountController(Controller):
|
|
173
173
|
account_partition, accounts = \
|
174
174
|
self.app.account_ring.get_nodes(self.account_name)
|
175
175
|
headers = self.generate_request_headers(req)
|
176
|
-
clear_info_cache(
|
176
|
+
clear_info_cache(req.environ, self.account_name)
|
177
177
|
resp = self.make_requests(
|
178
178
|
req, self.app.account_ring, account_partition, 'DELETE',
|
179
179
|
req.swift_entity_path, [headers] * len(accounts))
|