swift 2.33.0__py2.py3-none-any.whl → 2.34.0__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 (112) hide show
  1. swift/account/auditor.py +11 -0
  2. swift/account/reaper.py +11 -1
  3. swift/account/replicator.py +22 -0
  4. swift/account/server.py +12 -1
  5. swift-2.33.0.data/scripts/swift-account-audit → swift/cli/account_audit.py +6 -2
  6. swift-2.33.0.data/scripts/swift-config → swift/cli/config.py +1 -1
  7. swift-2.33.0.data/scripts/swift-dispersion-populate → swift/cli/dispersion_populate.py +6 -2
  8. swift-2.33.0.data/scripts/swift-drive-audit → swift/cli/drive_audit.py +12 -3
  9. swift-2.33.0.data/scripts/swift-get-nodes → swift/cli/get_nodes.py +6 -2
  10. swift/cli/info.py +103 -2
  11. swift-2.33.0.data/scripts/swift-oldies → swift/cli/oldies.py +6 -3
  12. swift-2.33.0.data/scripts/swift-orphans → swift/cli/orphans.py +7 -2
  13. swift/cli/recon_cron.py +5 -5
  14. swift-2.33.0.data/scripts/swift-reconciler-enqueue → swift/cli/reconciler_enqueue.py +2 -3
  15. swift/cli/relinker.py +1 -1
  16. swift/cli/ringbuilder.py +24 -0
  17. swift/common/db.py +2 -1
  18. swift/common/db_auditor.py +2 -2
  19. swift/common/db_replicator.py +6 -0
  20. swift/common/exceptions.py +12 -0
  21. swift/common/manager.py +102 -0
  22. swift/common/memcached.py +6 -13
  23. swift/common/middleware/account_quotas.py +144 -43
  24. swift/common/middleware/backend_ratelimit.py +166 -24
  25. swift/common/middleware/catch_errors.py +1 -3
  26. swift/common/middleware/cname_lookup.py +3 -5
  27. swift/common/middleware/container_sync.py +6 -10
  28. swift/common/middleware/crypto/crypto_utils.py +4 -5
  29. swift/common/middleware/crypto/decrypter.py +4 -5
  30. swift/common/middleware/crypto/kms_keymaster.py +2 -1
  31. swift/common/middleware/proxy_logging.py +22 -16
  32. swift/common/middleware/ratelimit.py +6 -7
  33. swift/common/middleware/recon.py +6 -7
  34. swift/common/middleware/s3api/acl_handlers.py +9 -0
  35. swift/common/middleware/s3api/controllers/multi_upload.py +1 -9
  36. swift/common/middleware/s3api/controllers/obj.py +20 -1
  37. swift/common/middleware/s3api/s3api.py +2 -0
  38. swift/common/middleware/s3api/s3request.py +171 -62
  39. swift/common/middleware/s3api/s3response.py +35 -6
  40. swift/common/middleware/s3api/s3token.py +2 -2
  41. swift/common/middleware/s3api/utils.py +1 -0
  42. swift/common/middleware/slo.py +153 -52
  43. swift/common/middleware/tempauth.py +6 -4
  44. swift/common/middleware/tempurl.py +2 -2
  45. swift/common/middleware/x_profile/exceptions.py +1 -4
  46. swift/common/middleware/x_profile/html_viewer.py +9 -10
  47. swift/common/middleware/x_profile/profile_model.py +1 -2
  48. swift/common/middleware/xprofile.py +1 -2
  49. swift/common/request_helpers.py +69 -0
  50. swift/common/statsd_client.py +207 -0
  51. swift/common/utils/__init__.py +97 -1635
  52. swift/common/utils/base.py +138 -0
  53. swift/common/utils/config.py +443 -0
  54. swift/common/utils/logs.py +999 -0
  55. swift/common/wsgi.py +11 -3
  56. swift/container/auditor.py +11 -0
  57. swift/container/backend.py +10 -10
  58. swift/container/reconciler.py +11 -2
  59. swift/container/replicator.py +22 -1
  60. swift/container/server.py +12 -1
  61. swift/container/sharder.py +36 -12
  62. swift/container/sync.py +11 -1
  63. swift/container/updater.py +11 -2
  64. swift/obj/auditor.py +18 -2
  65. swift/obj/diskfile.py +8 -6
  66. swift/obj/expirer.py +155 -36
  67. swift/obj/reconstructor.py +28 -4
  68. swift/obj/replicator.py +61 -22
  69. swift/obj/server.py +64 -36
  70. swift/obj/updater.py +11 -2
  71. swift/proxy/controllers/base.py +38 -22
  72. swift/proxy/controllers/obj.py +23 -26
  73. swift/proxy/server.py +15 -1
  74. {swift-2.33.0.dist-info → swift-2.34.0.dist-info}/AUTHORS +11 -3
  75. {swift-2.33.0.dist-info → swift-2.34.0.dist-info}/METADATA +6 -5
  76. {swift-2.33.0.dist-info → swift-2.34.0.dist-info}/RECORD +81 -107
  77. {swift-2.33.0.dist-info → swift-2.34.0.dist-info}/entry_points.txt +38 -0
  78. swift-2.34.0.dist-info/pbr.json +1 -0
  79. swift-2.33.0.data/scripts/swift-account-auditor +0 -23
  80. swift-2.33.0.data/scripts/swift-account-info +0 -52
  81. swift-2.33.0.data/scripts/swift-account-reaper +0 -23
  82. swift-2.33.0.data/scripts/swift-account-replicator +0 -34
  83. swift-2.33.0.data/scripts/swift-account-server +0 -23
  84. swift-2.33.0.data/scripts/swift-container-auditor +0 -23
  85. swift-2.33.0.data/scripts/swift-container-info +0 -59
  86. swift-2.33.0.data/scripts/swift-container-reconciler +0 -21
  87. swift-2.33.0.data/scripts/swift-container-replicator +0 -34
  88. swift-2.33.0.data/scripts/swift-container-server +0 -23
  89. swift-2.33.0.data/scripts/swift-container-sharder +0 -37
  90. swift-2.33.0.data/scripts/swift-container-sync +0 -23
  91. swift-2.33.0.data/scripts/swift-container-updater +0 -23
  92. swift-2.33.0.data/scripts/swift-dispersion-report +0 -24
  93. swift-2.33.0.data/scripts/swift-form-signature +0 -20
  94. swift-2.33.0.data/scripts/swift-init +0 -119
  95. swift-2.33.0.data/scripts/swift-object-auditor +0 -29
  96. swift-2.33.0.data/scripts/swift-object-expirer +0 -33
  97. swift-2.33.0.data/scripts/swift-object-info +0 -60
  98. swift-2.33.0.data/scripts/swift-object-reconstructor +0 -33
  99. swift-2.33.0.data/scripts/swift-object-relinker +0 -23
  100. swift-2.33.0.data/scripts/swift-object-replicator +0 -37
  101. swift-2.33.0.data/scripts/swift-object-server +0 -27
  102. swift-2.33.0.data/scripts/swift-object-updater +0 -23
  103. swift-2.33.0.data/scripts/swift-proxy-server +0 -23
  104. swift-2.33.0.data/scripts/swift-recon +0 -24
  105. swift-2.33.0.data/scripts/swift-recon-cron +0 -24
  106. swift-2.33.0.data/scripts/swift-ring-builder +0 -37
  107. swift-2.33.0.data/scripts/swift-ring-builder-analyzer +0 -22
  108. swift-2.33.0.data/scripts/swift-ring-composer +0 -22
  109. swift-2.33.0.dist-info/pbr.json +0 -1
  110. {swift-2.33.0.dist-info → swift-2.34.0.dist-info}/LICENSE +0 -0
  111. {swift-2.33.0.dist-info → swift-2.34.0.dist-info}/WHEEL +0 -0
  112. {swift-2.33.0.dist-info → swift-2.34.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
- 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(test_config=True)
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,59 +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
-
38
- if __name__ == '__main__':
39
- parser = OptionParser('%prog [options] CONTAINER_DB_FILE')
40
- parser.add_option(
41
- '-d', '--swift-dir', default='/etc/swift',
42
- help="Pass location of swift directory")
43
- parser.add_option(
44
- '--drop-prefixes', default=False, action="store_true",
45
- help="When outputting metadata, drop the per-section common prefixes")
46
- parser.add_option(
47
- '-v', '--verbose', default=False, action="store_true",
48
- help="Show all shard ranges. By default, only the number of shard "
49
- "ranges is displayed if there are many shards.")
50
- parser.add_option(
51
- '--sync', '-s', default=False, action="store_true",
52
- help="Output the contents of the incoming/outging sync tables")
53
-
54
- options, args = parser.parse_args()
55
-
56
- if len(args) != 1:
57
- sys.exit(parser.print_help())
58
-
59
- 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,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(test_config=True)
23
- sys.exit(run_wsgi(conf_file, 'container-server', **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)
@@ -1,60 +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 codecs
18
- import sys
19
- from optparse import OptionParser
20
-
21
- import six
22
-
23
- from swift.common.storage_policy import reload_storage_policies
24
- from swift.common.utils import set_swift_dir
25
- from swift.cli.info import print_obj, InfoSystemExit
26
-
27
-
28
- if __name__ == '__main__':
29
- if not six.PY2:
30
- # Make stdout able to write escaped bytes
31
- sys.stdout = codecs.getwriter("utf-8")(
32
- sys.stdout.detach(), errors='surrogateescape')
33
-
34
- parser = OptionParser('%prog [options] OBJECT_FILE')
35
- parser.add_option(
36
- '-n', '--no-check-etag', default=True,
37
- action="store_false", dest="check_etag",
38
- help="Don't verify file contents against stored etag")
39
- parser.add_option(
40
- '-d', '--swift-dir', default='/etc/swift', dest='swift_dir',
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
- '-P', '--policy-name', dest='policy_name',
47
- help="Specify storage policy name")
48
-
49
- options, args = parser.parse_args()
50
-
51
- if len(args) != 1:
52
- sys.exit(parser.print_help())
53
-
54
- if set_swift_dir(options.swift_dir):
55
- reload_storage_policies()
56
-
57
- try:
58
- print_obj(*args, **vars(options))
59
- except InfoSystemExit:
60
- sys.exit(1)
@@ -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.obj.reconstructor import ObjectReconstructor
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='Reconstruct only given devices. '
26
- 'Comma-separated list. '
27
- 'Only has effect if --once is used.')
28
- parser.add_option('-p', '--partitions',
29
- help='Reconstruct only given partitions. '
30
- 'Comma-separated list. '
31
- 'Only has effect if --once is used.')
32
- conf_file, options = parse_options(parser=parser, once=True)
33
- run_daemon(ObjectReconstructor, conf_file, **options)
@@ -1,23 +0,0 @@
1
- #!python
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
- # implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
-
17
- import sys
18
-
19
- from swift.cli.relinker import main
20
-
21
-
22
- if __name__ == '__main__':
23
- sys.exit(main(sys.argv[1:]))
@@ -1,37 +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.replicator import ObjectReplicator
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='Replicate only given devices. '
26
- 'Comma-separated list. '
27
- 'Only has effect if --once is used.')
28
- parser.add_option('-p', '--partitions',
29
- help='Replicate only given partitions. '
30
- 'Comma-separated list. '
31
- 'Only has effect if --once is used.')
32
- parser.add_option('-i', '--policies',
33
- help='Replicate only given policy indices. '
34
- 'Comma-separated list. '
35
- 'Only has effect if --once is used.')
36
- conf_file, options = parse_options(parser=parser, once=True)
37
- run_daemon(ObjectReplicator, conf_file, **options)