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/common/ring/ring.py
CHANGED
@@ -48,6 +48,23 @@ def calc_replica_count(replica2part2dev_id):
|
|
48
48
|
return base + extra
|
49
49
|
|
50
50
|
|
51
|
+
def normalize_devices(devs):
|
52
|
+
# NOTE(akscram): Replication parameters like replication_ip
|
53
|
+
# and replication_port are required for
|
54
|
+
# replication process. An old replication
|
55
|
+
# ring doesn't contain this parameters into
|
56
|
+
# device. Old-style pickled rings won't have
|
57
|
+
# region information.
|
58
|
+
for dev in devs:
|
59
|
+
if dev is None:
|
60
|
+
continue
|
61
|
+
dev.setdefault('region', 1)
|
62
|
+
if 'ip' in dev:
|
63
|
+
dev.setdefault('replication_ip', dev['ip'])
|
64
|
+
if 'port' in dev:
|
65
|
+
dev.setdefault('replication_port', dev['port'])
|
66
|
+
|
67
|
+
|
51
68
|
class RingReader(object):
|
52
69
|
chunk_size = 2 ** 16
|
53
70
|
|
@@ -118,6 +135,7 @@ class RingData(object):
|
|
118
135
|
|
119
136
|
def __init__(self, replica2part2dev_id, devs, part_shift,
|
120
137
|
next_part_power=None, version=None):
|
138
|
+
normalize_devices(devs)
|
121
139
|
self.devs = devs
|
122
140
|
self._replica2part2dev_id = replica2part2dev_id
|
123
141
|
self._part_shift = part_shift
|
@@ -125,10 +143,6 @@ class RingData(object):
|
|
125
143
|
self.version = version
|
126
144
|
self.md5 = self.size = self.raw_size = None
|
127
145
|
|
128
|
-
for dev in self.devs:
|
129
|
-
if dev is not None:
|
130
|
-
dev.setdefault("region", 1)
|
131
|
-
|
132
146
|
@property
|
133
147
|
def replica_count(self):
|
134
148
|
"""Number of replicas (full or partial) used in the ring."""
|
@@ -194,7 +208,10 @@ class RingData(object):
|
|
194
208
|
gz_file.seek(0)
|
195
209
|
ring_data = pickle.load(gz_file)
|
196
210
|
|
197
|
-
if
|
211
|
+
if hasattr(ring_data, 'devs'):
|
212
|
+
# pickled RingData; make sure we've got region/replication info
|
213
|
+
normalize_devices(ring_data.devs)
|
214
|
+
else:
|
198
215
|
ring_data = RingData(ring_data['replica2part2dev_id'],
|
199
216
|
ring_data['devs'], ring_data['part_shift'],
|
200
217
|
ring_data.get('next_part_power'),
|
@@ -306,20 +323,6 @@ class Ring(object):
|
|
306
323
|
|
307
324
|
self._mtime = getmtime(self.serialized_path)
|
308
325
|
self._devs = ring_data.devs
|
309
|
-
# NOTE(akscram): Replication parameters like replication_ip
|
310
|
-
# and replication_port are required for
|
311
|
-
# replication process. An old replication
|
312
|
-
# ring doesn't contain this parameters into
|
313
|
-
# device. Old-style pickled rings won't have
|
314
|
-
# region information.
|
315
|
-
for dev in self._devs:
|
316
|
-
if dev:
|
317
|
-
dev.setdefault('region', 1)
|
318
|
-
if 'ip' in dev:
|
319
|
-
dev.setdefault('replication_ip', dev['ip'])
|
320
|
-
if 'port' in dev:
|
321
|
-
dev.setdefault('replication_port', dev['port'])
|
322
|
-
|
323
326
|
self._replica2part2dev_id = ring_data._replica2part2dev_id
|
324
327
|
self._part_shift = ring_data._part_shift
|
325
328
|
self._rebuild_tier_data()
|
swift/common/swob.py
CHANGED
@@ -55,7 +55,7 @@ from six.moves import urllib
|
|
55
55
|
|
56
56
|
from swift.common.header_key_dict import HeaderKeyDict
|
57
57
|
from swift.common.utils import UTC, reiterate, split_path, Timestamp, pairs, \
|
58
|
-
close_if_possible, closing_if_possible, config_true_value
|
58
|
+
close_if_possible, closing_if_possible, config_true_value, drain_and_close
|
59
59
|
from swift.common.exceptions import InvalidTimestamp
|
60
60
|
|
61
61
|
|
@@ -1400,6 +1400,7 @@ class Response(object):
|
|
1400
1400
|
|
1401
1401
|
if self.request and self.request.method == 'HEAD':
|
1402
1402
|
# We explicitly do NOT want to set self.content_length to 0 here
|
1403
|
+
drain_and_close(app_iter) # be friendly to our app_iter
|
1403
1404
|
return [b'']
|
1404
1405
|
|
1405
1406
|
if self.conditional_response and self.request and \
|