swift 2.23.3__py3-none-any.whl → 2.35.0__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 (206) hide show
  1. swift/__init__.py +29 -50
  2. swift/account/auditor.py +21 -118
  3. swift/account/backend.py +33 -28
  4. swift/account/reaper.py +37 -28
  5. swift/account/replicator.py +22 -0
  6. swift/account/server.py +60 -26
  7. swift/account/utils.py +28 -11
  8. swift-2.23.3.data/scripts/swift-account-audit → swift/cli/account_audit.py +23 -13
  9. swift-2.23.3.data/scripts/swift-config → swift/cli/config.py +2 -2
  10. swift/cli/container_deleter.py +5 -11
  11. swift-2.23.3.data/scripts/swift-dispersion-populate → swift/cli/dispersion_populate.py +8 -7
  12. swift/cli/dispersion_report.py +10 -9
  13. swift-2.23.3.data/scripts/swift-drive-audit → swift/cli/drive_audit.py +63 -21
  14. swift/cli/form_signature.py +3 -7
  15. swift-2.23.3.data/scripts/swift-get-nodes → swift/cli/get_nodes.py +8 -2
  16. swift/cli/info.py +154 -14
  17. swift/cli/manage_shard_ranges.py +705 -37
  18. swift-2.23.3.data/scripts/swift-oldies → swift/cli/oldies.py +25 -14
  19. swift-2.23.3.data/scripts/swift-orphans → swift/cli/orphans.py +7 -3
  20. swift/cli/recon.py +196 -67
  21. swift-2.23.3.data/scripts/swift-recon-cron → swift/cli/recon_cron.py +17 -20
  22. swift-2.23.3.data/scripts/swift-reconciler-enqueue → swift/cli/reconciler_enqueue.py +2 -3
  23. swift/cli/relinker.py +807 -126
  24. swift/cli/reload.py +135 -0
  25. swift/cli/ringbuilder.py +217 -20
  26. swift/cli/ringcomposer.py +0 -1
  27. swift/cli/shard-info.py +4 -3
  28. swift/common/base_storage_server.py +9 -20
  29. swift/common/bufferedhttp.py +48 -74
  30. swift/common/constraints.py +20 -15
  31. swift/common/container_sync_realms.py +9 -11
  32. swift/common/daemon.py +25 -8
  33. swift/common/db.py +195 -128
  34. swift/common/db_auditor.py +168 -0
  35. swift/common/db_replicator.py +95 -55
  36. swift/common/digest.py +141 -0
  37. swift/common/direct_client.py +144 -33
  38. swift/common/error_limiter.py +93 -0
  39. swift/common/exceptions.py +25 -1
  40. swift/common/header_key_dict.py +2 -9
  41. swift/common/http_protocol.py +373 -0
  42. swift/common/internal_client.py +129 -59
  43. swift/common/linkat.py +3 -4
  44. swift/common/manager.py +284 -67
  45. swift/common/memcached.py +390 -145
  46. swift/common/middleware/__init__.py +4 -0
  47. swift/common/middleware/account_quotas.py +211 -46
  48. swift/common/middleware/acl.py +3 -8
  49. swift/common/middleware/backend_ratelimit.py +230 -0
  50. swift/common/middleware/bulk.py +22 -34
  51. swift/common/middleware/catch_errors.py +1 -3
  52. swift/common/middleware/cname_lookup.py +6 -11
  53. swift/common/middleware/container_quotas.py +1 -1
  54. swift/common/middleware/container_sync.py +39 -17
  55. swift/common/middleware/copy.py +12 -0
  56. swift/common/middleware/crossdomain.py +22 -9
  57. swift/common/middleware/crypto/__init__.py +2 -1
  58. swift/common/middleware/crypto/crypto_utils.py +11 -15
  59. swift/common/middleware/crypto/decrypter.py +28 -11
  60. swift/common/middleware/crypto/encrypter.py +12 -17
  61. swift/common/middleware/crypto/keymaster.py +8 -15
  62. swift/common/middleware/crypto/kms_keymaster.py +2 -1
  63. swift/common/middleware/dlo.py +15 -11
  64. swift/common/middleware/domain_remap.py +5 -4
  65. swift/common/middleware/etag_quoter.py +128 -0
  66. swift/common/middleware/formpost.py +73 -70
  67. swift/common/middleware/gatekeeper.py +8 -1
  68. swift/common/middleware/keystoneauth.py +33 -3
  69. swift/common/middleware/list_endpoints.py +4 -4
  70. swift/common/middleware/listing_formats.py +85 -49
  71. swift/common/middleware/memcache.py +4 -95
  72. swift/common/middleware/name_check.py +3 -2
  73. swift/common/middleware/proxy_logging.py +160 -92
  74. swift/common/middleware/ratelimit.py +17 -10
  75. swift/common/middleware/read_only.py +6 -4
  76. swift/common/middleware/recon.py +59 -22
  77. swift/common/middleware/s3api/acl_handlers.py +25 -3
  78. swift/common/middleware/s3api/acl_utils.py +6 -1
  79. swift/common/middleware/s3api/controllers/__init__.py +6 -0
  80. swift/common/middleware/s3api/controllers/acl.py +3 -2
  81. swift/common/middleware/s3api/controllers/bucket.py +242 -137
  82. swift/common/middleware/s3api/controllers/logging.py +2 -2
  83. swift/common/middleware/s3api/controllers/multi_delete.py +43 -20
  84. swift/common/middleware/s3api/controllers/multi_upload.py +219 -133
  85. swift/common/middleware/s3api/controllers/obj.py +112 -8
  86. swift/common/middleware/s3api/controllers/object_lock.py +44 -0
  87. swift/common/middleware/s3api/controllers/s3_acl.py +2 -2
  88. swift/common/middleware/s3api/controllers/tagging.py +57 -0
  89. swift/common/middleware/s3api/controllers/versioning.py +36 -7
  90. swift/common/middleware/s3api/etree.py +22 -9
  91. swift/common/middleware/s3api/exception.py +0 -4
  92. swift/common/middleware/s3api/s3api.py +113 -41
  93. swift/common/middleware/s3api/s3request.py +384 -218
  94. swift/common/middleware/s3api/s3response.py +126 -23
  95. swift/common/middleware/s3api/s3token.py +16 -17
  96. swift/common/middleware/s3api/schema/delete.rng +1 -1
  97. swift/common/middleware/s3api/subresource.py +7 -10
  98. swift/common/middleware/s3api/utils.py +27 -10
  99. swift/common/middleware/slo.py +665 -358
  100. swift/common/middleware/staticweb.py +64 -37
  101. swift/common/middleware/symlink.py +51 -18
  102. swift/common/middleware/tempauth.py +76 -58
  103. swift/common/middleware/tempurl.py +191 -173
  104. swift/common/middleware/versioned_writes/__init__.py +51 -0
  105. swift/common/middleware/{versioned_writes.py → versioned_writes/legacy.py} +27 -26
  106. swift/common/middleware/versioned_writes/object_versioning.py +1482 -0
  107. swift/common/middleware/x_profile/exceptions.py +1 -4
  108. swift/common/middleware/x_profile/html_viewer.py +18 -19
  109. swift/common/middleware/x_profile/profile_model.py +1 -2
  110. swift/common/middleware/xprofile.py +10 -10
  111. swift-2.23.3.data/scripts/swift-container-server → swift/common/recon.py +13 -8
  112. swift/common/registry.py +147 -0
  113. swift/common/request_helpers.py +324 -57
  114. swift/common/ring/builder.py +67 -25
  115. swift/common/ring/composite_builder.py +1 -1
  116. swift/common/ring/ring.py +177 -51
  117. swift/common/ring/utils.py +1 -1
  118. swift/common/splice.py +10 -6
  119. swift/common/statsd_client.py +205 -0
  120. swift/common/storage_policy.py +49 -44
  121. swift/common/swob.py +86 -102
  122. swift/common/{utils.py → utils/__init__.py} +2163 -2772
  123. swift/common/utils/base.py +131 -0
  124. swift/common/utils/config.py +433 -0
  125. swift/common/utils/ipaddrs.py +256 -0
  126. swift/common/utils/libc.py +345 -0
  127. swift/common/utils/logs.py +859 -0
  128. swift/common/utils/timestamp.py +412 -0
  129. swift/common/wsgi.py +553 -535
  130. swift/container/auditor.py +14 -100
  131. swift/container/backend.py +490 -231
  132. swift/container/reconciler.py +126 -37
  133. swift/container/replicator.py +96 -22
  134. swift/container/server.py +358 -165
  135. swift/container/sharder.py +1540 -684
  136. swift/container/sync.py +94 -88
  137. swift/container/updater.py +53 -32
  138. swift/obj/auditor.py +153 -35
  139. swift/obj/diskfile.py +466 -217
  140. swift/obj/expirer.py +406 -124
  141. swift/obj/mem_diskfile.py +7 -4
  142. swift/obj/mem_server.py +1 -0
  143. swift/obj/reconstructor.py +523 -262
  144. swift/obj/replicator.py +249 -188
  145. swift/obj/server.py +207 -122
  146. swift/obj/ssync_receiver.py +145 -85
  147. swift/obj/ssync_sender.py +113 -54
  148. swift/obj/updater.py +652 -139
  149. swift/obj/watchers/__init__.py +0 -0
  150. swift/obj/watchers/dark_data.py +213 -0
  151. swift/proxy/controllers/account.py +11 -11
  152. swift/proxy/controllers/base.py +848 -604
  153. swift/proxy/controllers/container.py +433 -92
  154. swift/proxy/controllers/info.py +3 -2
  155. swift/proxy/controllers/obj.py +1000 -489
  156. swift/proxy/server.py +185 -112
  157. {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/AUTHORS +58 -11
  158. {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/METADATA +51 -56
  159. swift-2.35.0.dist-info/RECORD +201 -0
  160. {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/WHEEL +1 -1
  161. {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/entry_points.txt +43 -0
  162. swift-2.35.0.dist-info/pbr.json +1 -0
  163. swift/locale/de/LC_MESSAGES/swift.po +0 -1216
  164. swift/locale/en_GB/LC_MESSAGES/swift.po +0 -1207
  165. swift/locale/es/LC_MESSAGES/swift.po +0 -1085
  166. swift/locale/fr/LC_MESSAGES/swift.po +0 -909
  167. swift/locale/it/LC_MESSAGES/swift.po +0 -894
  168. swift/locale/ja/LC_MESSAGES/swift.po +0 -965
  169. swift/locale/ko_KR/LC_MESSAGES/swift.po +0 -964
  170. swift/locale/pt_BR/LC_MESSAGES/swift.po +0 -881
  171. swift/locale/ru/LC_MESSAGES/swift.po +0 -891
  172. swift/locale/tr_TR/LC_MESSAGES/swift.po +0 -832
  173. swift/locale/zh_CN/LC_MESSAGES/swift.po +0 -833
  174. swift/locale/zh_TW/LC_MESSAGES/swift.po +0 -838
  175. swift-2.23.3.data/scripts/swift-account-auditor +0 -23
  176. swift-2.23.3.data/scripts/swift-account-info +0 -51
  177. swift-2.23.3.data/scripts/swift-account-reaper +0 -23
  178. swift-2.23.3.data/scripts/swift-account-replicator +0 -34
  179. swift-2.23.3.data/scripts/swift-account-server +0 -23
  180. swift-2.23.3.data/scripts/swift-container-auditor +0 -23
  181. swift-2.23.3.data/scripts/swift-container-info +0 -55
  182. swift-2.23.3.data/scripts/swift-container-reconciler +0 -21
  183. swift-2.23.3.data/scripts/swift-container-replicator +0 -34
  184. swift-2.23.3.data/scripts/swift-container-sharder +0 -37
  185. swift-2.23.3.data/scripts/swift-container-sync +0 -23
  186. swift-2.23.3.data/scripts/swift-container-updater +0 -23
  187. swift-2.23.3.data/scripts/swift-dispersion-report +0 -24
  188. swift-2.23.3.data/scripts/swift-form-signature +0 -20
  189. swift-2.23.3.data/scripts/swift-init +0 -119
  190. swift-2.23.3.data/scripts/swift-object-auditor +0 -29
  191. swift-2.23.3.data/scripts/swift-object-expirer +0 -33
  192. swift-2.23.3.data/scripts/swift-object-info +0 -60
  193. swift-2.23.3.data/scripts/swift-object-reconstructor +0 -33
  194. swift-2.23.3.data/scripts/swift-object-relinker +0 -41
  195. swift-2.23.3.data/scripts/swift-object-replicator +0 -37
  196. swift-2.23.3.data/scripts/swift-object-server +0 -27
  197. swift-2.23.3.data/scripts/swift-object-updater +0 -23
  198. swift-2.23.3.data/scripts/swift-proxy-server +0 -23
  199. swift-2.23.3.data/scripts/swift-recon +0 -24
  200. swift-2.23.3.data/scripts/swift-ring-builder +0 -24
  201. swift-2.23.3.data/scripts/swift-ring-builder-analyzer +0 -22
  202. swift-2.23.3.data/scripts/swift-ring-composer +0 -22
  203. swift-2.23.3.dist-info/RECORD +0 -220
  204. swift-2.23.3.dist-info/pbr.json +0 -1
  205. {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/LICENSE +0 -0
  206. {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/top_level.txt +0 -0
@@ -1,23 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.account.auditor import AccountAuditor
18
- from swift.common.utils import parse_options
19
- from swift.common.daemon import run_daemon
20
-
21
- if __name__ == '__main__':
22
- conf_file, options = parse_options(once=True)
23
- run_daemon(AccountAuditor, conf_file, **options)
@@ -1,51 +0,0 @@
1
- #!python
2
- # Licensed under the Apache License, Version 2.0 (the "License"); you may not
3
- # use this file except in compliance with the License. You may obtain a copy
4
- # of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- # License for the specific language governing permissions and limitations
12
- # under the License.
13
-
14
- import sqlite3
15
- import sys
16
- from optparse import OptionParser
17
-
18
- from swift.cli.info import print_info, InfoSystemExit
19
- from swift.common.exceptions import LockTimeout
20
-
21
-
22
- def run_print_info(args, opts):
23
- try:
24
- print_info('account', *args, **opts)
25
- except InfoSystemExit:
26
- sys.exit(1)
27
- except (sqlite3.OperationalError, LockTimeout) as e:
28
- if not opts.get('stale_reads_ok'):
29
- opts['stale_reads_ok'] = True
30
- print('Warning: Possibly Stale Data')
31
- run_print_info(args, opts)
32
- sys.exit(2)
33
- else:
34
- print('Account info failed: %s' % e)
35
- sys.exit(1)
36
-
37
- if __name__ == '__main__':
38
- parser = OptionParser('%prog [options] ACCOUNT_DB_FILE')
39
- parser.add_option(
40
- '-d', '--swift-dir', default='/etc/swift',
41
- help="Pass location of swift directory")
42
- parser.add_option(
43
- '--drop-prefixes', default=False, action="store_true",
44
- help="When outputting metadata, drop the per-section common prefixes")
45
-
46
- options, args = parser.parse_args()
47
-
48
- if len(args) != 1:
49
- sys.exit(parser.print_help())
50
-
51
- run_print_info(args, vars(options))
@@ -1,23 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.account.reaper import AccountReaper
18
- from swift.common.utils import parse_options
19
- from swift.common.daemon import run_daemon
20
-
21
- if __name__ == '__main__':
22
- conf_file, options = parse_options(once=True)
23
- run_daemon(AccountReaper, conf_file, **options)
@@ -1,34 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- import optparse
18
-
19
- from swift.account.replicator import AccountReplicator
20
- from swift.common.utils import parse_options
21
- from swift.common.daemon import run_daemon
22
-
23
- if __name__ == '__main__':
24
- parser = optparse.OptionParser("%prog CONFIG [options]")
25
- parser.add_option('-d', '--devices',
26
- help=('Replicate only given devices. '
27
- 'Comma-separated list. '
28
- 'Only has effect if --once is used.'))
29
- parser.add_option('-p', '--partitions',
30
- help=('Replicate only given partitions. '
31
- 'Comma-separated list. '
32
- 'Only has effect if --once is used.'))
33
- conf_file, options = parse_options(parser=parser, once=True)
34
- run_daemon(AccountReplicator, conf_file, **options)
@@ -1,23 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- import sys
18
- from swift.common.utils import parse_options
19
- from swift.common.wsgi import run_wsgi
20
-
21
- if __name__ == '__main__':
22
- conf_file, options = parse_options()
23
- sys.exit(run_wsgi(conf_file, 'account-server', **options))
@@ -1,23 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.container.auditor import ContainerAuditor
18
- from swift.common.utils import parse_options
19
- from swift.common.daemon import run_daemon
20
-
21
- if __name__ == '__main__':
22
- conf_file, options = parse_options(once=True)
23
- run_daemon(ContainerAuditor, conf_file, **options)
@@ -1,55 +0,0 @@
1
- #!python
2
- # Licensed under the Apache License, Version 2.0 (the "License"); you may not
3
- # use this file except in compliance with the License. You may obtain a copy
4
- # of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- # License for the specific language governing permissions and limitations
12
- # under the License.
13
-
14
- import sqlite3
15
- import sys
16
- from optparse import OptionParser
17
-
18
- from swift.cli.info import print_info, InfoSystemExit
19
- from swift.common.exceptions import LockTimeout
20
-
21
-
22
- def run_print_info(args, opts):
23
- try:
24
- print_info('container', *args, **opts)
25
- except InfoSystemExit:
26
- sys.exit(1)
27
- except (sqlite3.OperationalError, LockTimeout) as e:
28
- if not opts.get('stale_reads_ok'):
29
- opts['stale_reads_ok'] = True
30
- print('Warning: Possibly Stale Data')
31
- run_print_info(args, opts)
32
- sys.exit(2)
33
- else:
34
- print('Container info failed: %s' % e)
35
- sys.exit(1)
36
-
37
- if __name__ == '__main__':
38
- parser = OptionParser('%prog [options] CONTAINER_DB_FILE')
39
- parser.add_option(
40
- '-d', '--swift-dir', default='/etc/swift',
41
- help="Pass location of swift directory")
42
- parser.add_option(
43
- '--drop-prefixes', default=False, action="store_true",
44
- help="When outputting metadata, drop the per-section common prefixes")
45
- parser.add_option(
46
- '-v', '--verbose', default=False, action="store_true",
47
- help="Show all shard ranges. By default, only the number of shard "
48
- "ranges is displayed if there are many shards.")
49
-
50
- options, args = parser.parse_args()
51
-
52
- if len(args) != 1:
53
- sys.exit(parser.print_help())
54
-
55
- run_print_info(args, vars(options))
@@ -1,21 +0,0 @@
1
- #!python
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11
- # implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from swift.container.reconciler import ContainerReconciler
16
- from swift.common.utils import parse_options
17
- from swift.common.daemon import run_daemon
18
-
19
- if __name__ == '__main__':
20
- conf_file, options = parse_options(once=True)
21
- run_daemon(ContainerReconciler, conf_file, **options)
@@ -1,34 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- import optparse
18
-
19
- from swift.container.replicator import ContainerReplicator
20
- from swift.common.utils import parse_options
21
- from swift.common.daemon import run_daemon
22
-
23
- if __name__ == '__main__':
24
- parser = optparse.OptionParser("%prog CONFIG [options]")
25
- parser.add_option('-d', '--devices',
26
- help=('Replicate only given devices. '
27
- 'Comma-separated list. '
28
- 'Only has effect if --once is used.'))
29
- parser.add_option('-p', '--partitions',
30
- help=('Replicate only given partitions. '
31
- 'Comma-separated list. '
32
- 'Only has effect if --once is used.'))
33
- conf_file, options = parse_options(parser=parser, once=True)
34
- run_daemon(ContainerReplicator, conf_file, **options)
@@ -1,37 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2015 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.container.sharder import ContainerSharder
18
- from swift.common.utils import parse_options
19
- from swift.common.daemon import run_daemon
20
- from optparse import OptionParser
21
-
22
- if __name__ == '__main__':
23
- parser = OptionParser("%prog CONFIG [options]")
24
- parser.add_option('-d', '--devices',
25
- help='Shard containers only on given devices. '
26
- 'Comma-separated list. '
27
- 'Only has effect if --once is used.')
28
- parser.add_option('-p', '--partitions',
29
- help='Shard containers only in given partitions. '
30
- 'Comma-separated list. '
31
- 'Only has effect if --once is used.')
32
- parser.add_option('--no-auto-shard', action='store_false',
33
- dest='auto_shard', default=None,
34
- help='Disable auto-sharding. Overrides the auto_shard '
35
- 'value in the config file.')
36
- conf_file, options = parse_options(parser=parser, once=True)
37
- run_daemon(ContainerSharder, conf_file, **options)
@@ -1,23 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.container.sync import ContainerSync
18
- from swift.common.utils import parse_options
19
- from swift.common.daemon import run_daemon
20
-
21
- if __name__ == '__main__':
22
- conf_file, options = parse_options(once=True)
23
- run_daemon(ContainerSync, conf_file, **options)
@@ -1,23 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.container.updater import ContainerUpdater
18
- from swift.common.utils import parse_options
19
- from swift.common.daemon import run_daemon
20
-
21
- if __name__ == '__main__':
22
- conf_file, options = parse_options(once=True)
23
- run_daemon(ContainerUpdater, conf_file, **options)
@@ -1,24 +0,0 @@
1
- #!python
2
- # Copyright (c) 2017 Christian Schwede <cschwede@redhat.com>
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- import sys
19
-
20
- from swift.cli.dispersion_report import main
21
-
22
-
23
- if __name__ == "__main__":
24
- sys.exit(main())
@@ -1,20 +0,0 @@
1
- #!python
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11
- # implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- import sys
16
- import swift.cli.form_signature
17
-
18
-
19
- if __name__ == "__main__":
20
- sys.exit(swift.cli.form_signature.main(sys.argv))
@@ -1,119 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- import sys
18
- from optparse import OptionParser
19
-
20
- from swift.common.manager import Manager, UnknownCommandError, \
21
- KILL_WAIT, RUN_DIR
22
-
23
- USAGE = \
24
- """%prog <server>[.<config>] [<server>[.<config>] ...] <command> [options]
25
-
26
- where:
27
- <server> is the name of a swift service e.g. proxy-server.
28
- The '-server' part of the name may be omitted.
29
- 'all', 'main' and 'rest' are reserved words that represent a
30
- group of services.
31
- all: Expands to all swift daemons.
32
- main: Expands to main swift daemons.
33
- (proxy, container, account, object)
34
- rest: Expands to all remaining background daemons (beyond
35
- "main").
36
- (updater, replicator, auditor, etc)
37
- <config> is an explicit configuration filename without the
38
- .conf extension. If <config> is specified then <server> should
39
- refer to a directory containing the configuration file, e.g.:
40
-
41
- swift-init object.1 start
42
-
43
- will start an object-server using the configuration file
44
- /etc/swift/object-server/1.conf
45
- <command> is a command from the list below.
46
-
47
- Commands:
48
- """ + '\n'.join(["%16s: %s" % x for x in Manager.list_commands()])
49
-
50
-
51
- def main():
52
- parser = OptionParser(USAGE)
53
- parser.add_option('-v', '--verbose', action="store_true",
54
- default=False, help="display verbose output")
55
- parser.add_option('-w', '--no-wait', action="store_false", dest="wait",
56
- default=True, help="won't wait for server to start "
57
- "before returning")
58
- parser.add_option('-o', '--once', action="store_true",
59
- default=False, help="only run one pass of daemon")
60
- # this is a negative option, default is options.daemon = True
61
- parser.add_option('-n', '--no-daemon', action="store_false", dest="daemon",
62
- default=True, help="start server interactively")
63
- parser.add_option('-g', '--graceful', action="store_true",
64
- default=False, help="send SIGHUP to supporting servers")
65
- parser.add_option('-c', '--config-num', metavar="N", type="int",
66
- dest="number", default=0,
67
- help="send command to the Nth server only")
68
- parser.add_option('-k', '--kill-wait', metavar="N", type="int",
69
- dest="kill_wait", default=KILL_WAIT,
70
- help="wait N seconds for processes to die (default 15)")
71
- parser.add_option('-r', '--run-dir', type="str",
72
- dest="run_dir", default=RUN_DIR,
73
- help="alternative directory to store running pid files "
74
- "default: %s" % RUN_DIR)
75
- # Changing behaviour if missing config
76
- parser.add_option('--strict', dest='strict', action='store_true',
77
- help="Return non-zero status code if some config is "
78
- "missing. Default mode if all servers are "
79
- "explicitly named.")
80
- # a negative option for strict
81
- parser.add_option('--non-strict', dest='strict', action='store_false',
82
- help="Return zero status code even if some config is "
83
- "missing. Default mode if any server is a glob or "
84
- "one of aliases `all`, `main` or `rest`.")
85
- # SIGKILL daemon after kill_wait period
86
- parser.add_option('--kill-after-timeout', dest='kill_after_timeout',
87
- action='store_true',
88
- help="Kill daemon and all children after kill-wait "
89
- "period.")
90
-
91
- options, args = parser.parse_args()
92
-
93
- if len(args) < 2:
94
- parser.print_help()
95
- print('ERROR: specify server(s) and command')
96
- return 1
97
-
98
- command = args[-1]
99
- servers = args[:-1]
100
-
101
- # this is just a silly swap for me cause I always try to "start main"
102
- commands = dict(Manager.list_commands()).keys()
103
- if command not in commands and servers[0] in commands:
104
- servers.append(command)
105
- command = servers.pop(0)
106
-
107
- manager = Manager(servers, run_dir=options.run_dir)
108
- try:
109
- status = manager.run_command(command, **options.__dict__)
110
- except UnknownCommandError:
111
- parser.print_help()
112
- print('ERROR: unknown command, %s' % command)
113
- status = 1
114
-
115
- return 1 if status else 0
116
-
117
-
118
- if __name__ == "__main__":
119
- sys.exit(main())
@@ -1,29 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.obj.auditor import ObjectAuditor
18
- from swift.common.utils import parse_options
19
- from swift.common.daemon import run_daemon
20
- from optparse import OptionParser
21
-
22
- if __name__ == '__main__':
23
- parser = OptionParser("%prog CONFIG [options]")
24
- parser.add_option('-z', '--zero_byte_fps',
25
- help='Audit only zero byte files at specified files/sec')
26
- parser.add_option('-d', '--devices',
27
- help='Audit only given devices. Comma-separated list')
28
- conf_file, options = parse_options(parser=parser, once=True)
29
- run_daemon(ObjectAuditor, conf_file, **options)
@@ -1,33 +0,0 @@
1
- #!python
2
- # Copyright (c) 2010-2012 OpenStack Foundation
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
- # implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from swift.common.daemon import run_daemon
18
- from swift.common.utils import parse_options
19
- from swift.obj.expirer import ObjectExpirer
20
- from optparse import OptionParser
21
-
22
- if __name__ == '__main__':
23
- parser = OptionParser("%prog CONFIG [options]")
24
- parser.add_option('--processes', dest='processes',
25
- help="Number of processes to use to do the work, don't "
26
- "use this option to do all the work in one process")
27
- parser.add_option('--process', dest='process',
28
- help="Process number for this process, don't use "
29
- "this option to do all the work in one process, this "
30
- "is used to determine which part of the work this "
31
- "process should do")
32
- conf_file, options = parse_options(parser=parser, once=True)
33
- run_daemon(ObjectExpirer, conf_file, **options)