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.
Files changed (104) hide show
  1. swift/cli/info.py +9 -2
  2. swift/cli/ringbuilder.py +5 -1
  3. swift/common/container_sync_realms.py +6 -7
  4. swift/common/daemon.py +7 -3
  5. swift/common/db.py +22 -7
  6. swift/common/db_replicator.py +19 -20
  7. swift/common/direct_client.py +63 -14
  8. swift/common/internal_client.py +24 -3
  9. swift/common/manager.py +43 -44
  10. swift/common/memcached.py +168 -74
  11. swift/common/middleware/__init__.py +4 -0
  12. swift/common/middleware/account_quotas.py +98 -40
  13. swift/common/middleware/backend_ratelimit.py +6 -4
  14. swift/common/middleware/crossdomain.py +21 -8
  15. swift/common/middleware/listing_formats.py +26 -38
  16. swift/common/middleware/proxy_logging.py +12 -9
  17. swift/common/middleware/s3api/controllers/bucket.py +8 -2
  18. swift/common/middleware/s3api/s3api.py +9 -4
  19. swift/common/middleware/s3api/s3request.py +32 -24
  20. swift/common/middleware/s3api/s3response.py +10 -1
  21. swift/common/middleware/tempauth.py +9 -10
  22. swift/common/middleware/versioned_writes/__init__.py +0 -3
  23. swift/common/middleware/versioned_writes/object_versioning.py +22 -5
  24. swift/common/middleware/x_profile/html_viewer.py +1 -1
  25. swift/common/middleware/xprofile.py +5 -0
  26. swift/common/request_helpers.py +1 -2
  27. swift/common/ring/ring.py +22 -19
  28. swift/common/swob.py +2 -1
  29. swift/common/{utils.py → utils/__init__.py} +610 -1146
  30. swift/common/utils/ipaddrs.py +256 -0
  31. swift/common/utils/libc.py +345 -0
  32. swift/common/utils/timestamp.py +399 -0
  33. swift/common/wsgi.py +70 -39
  34. swift/container/backend.py +106 -38
  35. swift/container/server.py +11 -2
  36. swift/container/sharder.py +34 -15
  37. swift/locale/de/LC_MESSAGES/swift.po +1 -320
  38. swift/locale/en_GB/LC_MESSAGES/swift.po +1 -347
  39. swift/locale/es/LC_MESSAGES/swift.po +1 -279
  40. swift/locale/fr/LC_MESSAGES/swift.po +1 -209
  41. swift/locale/it/LC_MESSAGES/swift.po +1 -207
  42. swift/locale/ja/LC_MESSAGES/swift.po +2 -278
  43. swift/locale/ko_KR/LC_MESSAGES/swift.po +3 -303
  44. swift/locale/pt_BR/LC_MESSAGES/swift.po +1 -204
  45. swift/locale/ru/LC_MESSAGES/swift.po +1 -203
  46. swift/locale/tr_TR/LC_MESSAGES/swift.po +1 -192
  47. swift/locale/zh_CN/LC_MESSAGES/swift.po +1 -192
  48. swift/locale/zh_TW/LC_MESSAGES/swift.po +1 -193
  49. swift/obj/diskfile.py +19 -6
  50. swift/obj/server.py +20 -6
  51. swift/obj/ssync_receiver.py +19 -9
  52. swift/obj/ssync_sender.py +10 -10
  53. swift/proxy/controllers/account.py +7 -7
  54. swift/proxy/controllers/base.py +374 -366
  55. swift/proxy/controllers/container.py +112 -53
  56. swift/proxy/controllers/obj.py +254 -390
  57. swift/proxy/server.py +3 -8
  58. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-server +1 -1
  59. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-server +1 -1
  60. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-drive-audit +45 -14
  61. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-server +1 -1
  62. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-proxy-server +1 -1
  63. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/AUTHORS +4 -0
  64. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/METADATA +32 -35
  65. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/RECORD +103 -100
  66. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/WHEEL +1 -1
  67. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/entry_points.txt +0 -1
  68. swift-2.32.1.dist-info/pbr.json +1 -0
  69. swift-2.31.1.dist-info/pbr.json +0 -1
  70. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-audit +0 -0
  71. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-auditor +0 -0
  72. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-info +0 -0
  73. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-reaper +0 -0
  74. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-replicator +0 -0
  75. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-config +0 -0
  76. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-auditor +0 -0
  77. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-info +0 -0
  78. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-reconciler +0 -0
  79. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-replicator +0 -0
  80. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-sharder +0 -0
  81. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-sync +0 -0
  82. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-updater +0 -0
  83. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-dispersion-populate +0 -0
  84. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-dispersion-report +0 -0
  85. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-form-signature +0 -0
  86. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-get-nodes +0 -0
  87. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-init +0 -0
  88. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-auditor +0 -0
  89. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-expirer +0 -0
  90. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-info +0 -0
  91. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-reconstructor +0 -0
  92. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-relinker +0 -0
  93. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-replicator +0 -0
  94. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-updater +0 -0
  95. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-oldies +0 -0
  96. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-orphans +0 -0
  97. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-recon +0 -0
  98. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-recon-cron +0 -0
  99. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-reconciler-enqueue +0 -0
  100. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-builder +0 -0
  101. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-builder-analyzer +0 -0
  102. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-composer +0 -0
  103. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/LICENSE +0 -0
  104. {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(_("WARNING: Unable to modify file descriptor limit. "
72
- "Running as non-root?"))
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(_("WARNING: Unable to modify memory limit. "
79
- "Running as non-root?"))
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(_("WARNING: Unable to modify max process limit. "
86
- "Running as non-root?"))
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(_('\nuser quit'))
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(_('No %s running') % server)
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(_("%(server)s (%(pid)s) appears to have stopped") %
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(_('Waited %(kill_wait)s seconds for %(server)s '
344
- 'to die; killing') %
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(_('Signal %(server)s pid: %(pid)s signal: '
349
- '%(signal)s') % {'server': server,
350
- 'pid': pid,
351
- 'signal': signal.SIGKILL})
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(_('Waited %(kill_wait)s seconds for %(server)s '
361
- 'to die; giving up') %
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(_('No %s running') % server)
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(_('No %s running') % server)
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(_('Found configs:'))
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(_('Unable to locate config number %(number)s for'
596
- ' %(server)s') %
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(_('Unable to locate config for %s') % self.server)
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(_("WARNING: object-expirer.conf is deprecated. "
605
- "Move object-expirers' configuration into "
606
- "object-server.conf."))
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(_('Signal %(server)s pid: %(pid)s signal: '
646
- '%(signal)s') %
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(_('Removing pid file %(pid_file)s with wrong pid '
652
- '%(pid)d') % {'pid_file': pid_file, 'pid': pid})
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(_("Removing stale pid file %s") % pid_file)
658
+ print("Removing stale pid file %s" % pid_file)
660
659
  remove_file(pid_file)
661
660
  elif e.errno == errno.EPERM:
662
- print(_("No permission to signal PID %d") % pid)
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(_('Removing pid file %s with invalid pid') % pid_file)
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(_('Removing pid file %s with invalid pid') % pid_file)
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(_("%(server)s #%(number)d not running (%(conf)s)") %
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(_("No %s running") % self.server)
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(_("%(server)s running (%(pid)s - %(conf)s)") %
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(_("%(server)s running (%(pid)s - %(conf)s)") %
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(_("%(server)s running (%(pid)s - %(pid_file)s)") %
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(_("%s already started...") % self.server)
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 = _('Running %s once') % self.server
902
+ msg = 'Running %s once' % self.server
904
903
  else:
905
- msg = _('Starting %s') % self.server
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(_("%s does not exist") % self.cmd)
911
+ print("%s does not exist" % self.cmd)
913
912
  break
914
913
  else:
915
914
  raise