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/manager.py
CHANGED
@@ -23,7 +23,6 @@ import time
|
|
23
23
|
import subprocess
|
24
24
|
import re
|
25
25
|
import six
|
26
|
-
from swift import gettext_ as _
|
27
26
|
import tempfile
|
28
27
|
from distutils.spawn import find_executable
|
29
28
|
|
@@ -68,22 +67,22 @@ def setup_env():
|
|
68
67
|
resource.setrlimit(resource.RLIMIT_NOFILE,
|
69
68
|
(MAX_DESCRIPTORS, MAX_DESCRIPTORS))
|
70
69
|
except ValueError:
|
71
|
-
print(
|
72
|
-
|
70
|
+
print("WARNING: Unable to modify file descriptor limit. "
|
71
|
+
"Running as non-root?")
|
73
72
|
|
74
73
|
try:
|
75
74
|
resource.setrlimit(resource.RLIMIT_DATA,
|
76
75
|
(MAX_MEMORY, MAX_MEMORY))
|
77
76
|
except ValueError:
|
78
|
-
print(
|
79
|
-
|
77
|
+
print("WARNING: Unable to modify memory limit. "
|
78
|
+
"Running as non-root?")
|
80
79
|
|
81
80
|
try:
|
82
81
|
resource.setrlimit(resource.RLIMIT_NPROC,
|
83
82
|
(MAX_PROCS, MAX_PROCS))
|
84
83
|
except ValueError:
|
85
|
-
print(
|
86
|
-
|
84
|
+
print("WARNING: Unable to modify max process limit. "
|
85
|
+
"Running as non-root?")
|
87
86
|
|
88
87
|
# Set PYTHON_EGG_CACHE if it isn't already set
|
89
88
|
os.environ.setdefault('PYTHON_EGG_CACHE', tempfile.gettempdir())
|
@@ -277,7 +276,7 @@ class Manager(object):
|
|
277
276
|
try:
|
278
277
|
status += server.interact(**kwargs)
|
279
278
|
except KeyboardInterrupt:
|
280
|
-
print(
|
279
|
+
print('\nuser quit')
|
281
280
|
self.stop(**kwargs)
|
282
281
|
break
|
283
282
|
elif kwargs.get('wait', True):
|
@@ -314,7 +313,7 @@ class Manager(object):
|
|
314
313
|
for server in self.servers:
|
315
314
|
signaled_pids = server.stop(**kwargs)
|
316
315
|
if not signaled_pids:
|
317
|
-
print(
|
316
|
+
print('No %s running' % server)
|
318
317
|
else:
|
319
318
|
server_pids[server] = signaled_pids
|
320
319
|
|
@@ -327,7 +326,7 @@ class Manager(object):
|
|
327
326
|
for server, killed_pid in watch_server_pids(server_pids,
|
328
327
|
interval=kill_wait,
|
329
328
|
**kwargs):
|
330
|
-
print(
|
329
|
+
print("%(server)s (%(pid)s) appears to have stopped" %
|
331
330
|
{'server': server, 'pid': killed_pid})
|
332
331
|
killed_pids.add(killed_pid)
|
333
332
|
if not killed_pids.symmetric_difference(signaled_pids):
|
@@ -340,15 +339,15 @@ class Manager(object):
|
|
340
339
|
if not killed_pids.issuperset(pids):
|
341
340
|
# some pids of this server were not killed
|
342
341
|
if kill_after_timeout:
|
343
|
-
print(
|
344
|
-
|
342
|
+
print('Waited %(kill_wait)s seconds for %(server)s '
|
343
|
+
'to die; killing' %
|
345
344
|
{'kill_wait': kill_wait, 'server': server})
|
346
345
|
# Send SIGKILL to all remaining pids
|
347
346
|
for pid in set(pids.keys()) - killed_pids:
|
348
|
-
print(
|
349
|
-
|
350
|
-
|
351
|
-
|
347
|
+
print('Signal %(server)s pid: %(pid)s signal: '
|
348
|
+
'%(signal)s' % {'server': server,
|
349
|
+
'pid': pid,
|
350
|
+
'signal': signal.SIGKILL})
|
352
351
|
# Send SIGKILL to process group
|
353
352
|
try:
|
354
353
|
kill_group(pid, signal.SIGKILL)
|
@@ -357,8 +356,8 @@ class Manager(object):
|
|
357
356
|
if e.errno != errno.ESRCH:
|
358
357
|
raise
|
359
358
|
else:
|
360
|
-
print(
|
361
|
-
|
359
|
+
print('Waited %(kill_wait)s seconds for %(server)s '
|
360
|
+
'to die; giving up' %
|
362
361
|
{'kill_wait': kill_wait, 'server': server})
|
363
362
|
return 1
|
364
363
|
|
@@ -414,7 +413,7 @@ class Manager(object):
|
|
414
413
|
for server in self.servers:
|
415
414
|
signaled_pids = server.stop(**kwargs)
|
416
415
|
if not signaled_pids:
|
417
|
-
print(
|
416
|
+
print('No %s running' % server)
|
418
417
|
status += 1
|
419
418
|
return status
|
420
419
|
|
@@ -424,7 +423,7 @@ class Manager(object):
|
|
424
423
|
for server in self.servers:
|
425
424
|
signaled_pids = server.kill_child_pids(**kwargs)
|
426
425
|
if not signaled_pids:
|
427
|
-
print(
|
426
|
+
print('No %s running' % server)
|
428
427
|
status += 1
|
429
428
|
return status
|
430
429
|
|
@@ -584,7 +583,7 @@ class Server(object):
|
|
584
583
|
|
585
584
|
def dump_found_configs():
|
586
585
|
if found_conf_files:
|
587
|
-
print(
|
586
|
+
print('Found configs:')
|
588
587
|
for i, conf_file in enumerate(found_conf_files):
|
589
588
|
print(' %d) %s' % (i + 1, conf_file))
|
590
589
|
|
@@ -592,18 +591,18 @@ class Server(object):
|
|
592
591
|
# maybe there's a config file(s) out there, but I couldn't find it!
|
593
592
|
if not kwargs.get('quiet'):
|
594
593
|
if number:
|
595
|
-
print(
|
596
|
-
|
594
|
+
print('Unable to locate config number %(number)s for'
|
595
|
+
' %(server)s' %
|
597
596
|
{'number': number, 'server': self.server})
|
598
597
|
else:
|
599
|
-
print(
|
598
|
+
print('Unable to locate config for %s' % self.server)
|
600
599
|
if kwargs.get('verbose') and not kwargs.get('quiet'):
|
601
600
|
dump_found_configs()
|
602
601
|
elif any(["object-expirer" in name for name in conf_files]) and \
|
603
602
|
not kwargs.get('quiet'):
|
604
|
-
print(
|
605
|
-
|
606
|
-
|
603
|
+
print("WARNING: object-expirer.conf is deprecated. "
|
604
|
+
"Move object-expirers' configuration into "
|
605
|
+
"object-server.conf.")
|
607
606
|
if kwargs.get('verbose'):
|
608
607
|
dump_found_configs()
|
609
608
|
|
@@ -642,24 +641,24 @@ class Server(object):
|
|
642
641
|
def _signal_pid(self, sig, pid, pid_file, verbose):
|
643
642
|
try:
|
644
643
|
if sig != signal.SIG_DFL:
|
645
|
-
print(
|
646
|
-
|
644
|
+
print('Signal %(server)s pid: %(pid)s signal: '
|
645
|
+
'%(signal)s' %
|
647
646
|
{'server': self.server, 'pid': pid, 'signal': sig})
|
648
647
|
safe_kill(pid, sig, 'swift-%s' % self.server)
|
649
648
|
except InvalidPidFileException:
|
650
649
|
if verbose:
|
651
|
-
print(
|
652
|
-
|
650
|
+
print('Removing pid file %(pid_file)s with wrong pid '
|
651
|
+
'%(pid)d' % {'pid_file': pid_file, 'pid': pid})
|
653
652
|
remove_file(pid_file)
|
654
653
|
return False
|
655
654
|
except OSError as e:
|
656
655
|
if e.errno == errno.ESRCH:
|
657
656
|
# pid does not exist
|
658
657
|
if verbose:
|
659
|
-
print(
|
658
|
+
print("Removing stale pid file %s" % pid_file)
|
660
659
|
remove_file(pid_file)
|
661
660
|
elif e.errno == errno.EPERM:
|
662
|
-
print(
|
661
|
+
print("No permission to signal PID %d" % pid)
|
663
662
|
return False
|
664
663
|
else:
|
665
664
|
# process exists
|
@@ -676,7 +675,7 @@ class Server(object):
|
|
676
675
|
pids = {}
|
677
676
|
for pid_file, pid in self.iter_pid_files(**kwargs):
|
678
677
|
if not pid: # Catches None and 0
|
679
|
-
print(
|
678
|
+
print('Removing pid file %s with invalid pid' % pid_file)
|
680
679
|
remove_file(pid_file)
|
681
680
|
continue
|
682
681
|
if self._signal_pid(sig, pid, pid_file, kwargs.get('verbose')):
|
@@ -694,7 +693,7 @@ class Server(object):
|
|
694
693
|
pids = {}
|
695
694
|
for pid_file, pid in self.iter_pid_files(**kwargs):
|
696
695
|
if not pid: # Catches None and 0
|
697
|
-
print(
|
696
|
+
print('Removing pid file %s with invalid pid' % pid_file)
|
698
697
|
remove_file(pid_file)
|
699
698
|
continue
|
700
699
|
ps_cmd = ['ps', '--ppid', str(pid), '--no-headers', '-o', 'pid']
|
@@ -766,15 +765,15 @@ class Server(object):
|
|
766
765
|
kwargs['quiet'] = True
|
767
766
|
conf_files = self.conf_files(**kwargs)
|
768
767
|
if conf_files:
|
769
|
-
print(
|
768
|
+
print("%(server)s #%(number)d not running (%(conf)s)" %
|
770
769
|
{'server': self.server, 'number': number,
|
771
770
|
'conf': conf_files[0]})
|
772
771
|
else:
|
773
|
-
print(
|
772
|
+
print("No %s running" % self.server)
|
774
773
|
return 1
|
775
774
|
for pid, pid_file in pids.items():
|
776
775
|
conf_file = self.get_conf_file_name(pid_file)
|
777
|
-
print(
|
776
|
+
print("%(server)s running (%(pid)s - %(conf)s)" %
|
778
777
|
{'server': self.server, 'pid': pid, 'conf': conf_file})
|
779
778
|
return 0
|
780
779
|
|
@@ -882,16 +881,16 @@ class Server(object):
|
|
882
881
|
# any unstarted instances
|
883
882
|
if conf_file in conf_files:
|
884
883
|
already_started = True
|
885
|
-
print(
|
884
|
+
print("%(server)s running (%(pid)s - %(conf)s)" %
|
886
885
|
{'server': self.server, 'pid': pid, 'conf': conf_file})
|
887
886
|
elif not kwargs.get('number', 0):
|
888
887
|
already_started = True
|
889
|
-
print(
|
888
|
+
print("%(server)s running (%(pid)s - %(pid_file)s)" %
|
890
889
|
{'server': self.server, 'pid': pid,
|
891
890
|
'pid_file': pid_file})
|
892
891
|
|
893
892
|
if already_started:
|
894
|
-
print(
|
893
|
+
print("%s already started..." % self.server)
|
895
894
|
return {}
|
896
895
|
|
897
896
|
if self.server not in START_ONCE_SERVERS:
|
@@ -900,16 +899,16 @@ class Server(object):
|
|
900
899
|
pids = {}
|
901
900
|
for conf_file in conf_files:
|
902
901
|
if kwargs.get('once'):
|
903
|
-
msg =
|
902
|
+
msg = 'Running %s once' % self.server
|
904
903
|
else:
|
905
|
-
msg =
|
904
|
+
msg = 'Starting %s' % self.server
|
906
905
|
print('%s...(%s)' % (msg, conf_file))
|
907
906
|
try:
|
908
907
|
pid = self.spawn(conf_file, **kwargs)
|
909
908
|
except OSError as e:
|
910
909
|
if e.errno == errno.ENOENT:
|
911
910
|
# TODO(clayg): should I check if self.cmd exists earlier?
|
912
|
-
print(
|
911
|
+
print("%s does not exist" % self.cmd)
|
913
912
|
break
|
914
913
|
else:
|
915
914
|
raise
|