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.
- swift/__init__.py +29 -50
- swift/account/auditor.py +21 -118
- swift/account/backend.py +33 -28
- swift/account/reaper.py +37 -28
- swift/account/replicator.py +22 -0
- swift/account/server.py +60 -26
- swift/account/utils.py +28 -11
- swift-2.23.3.data/scripts/swift-account-audit → swift/cli/account_audit.py +23 -13
- swift-2.23.3.data/scripts/swift-config → swift/cli/config.py +2 -2
- swift/cli/container_deleter.py +5 -11
- swift-2.23.3.data/scripts/swift-dispersion-populate → swift/cli/dispersion_populate.py +8 -7
- swift/cli/dispersion_report.py +10 -9
- swift-2.23.3.data/scripts/swift-drive-audit → swift/cli/drive_audit.py +63 -21
- swift/cli/form_signature.py +3 -7
- swift-2.23.3.data/scripts/swift-get-nodes → swift/cli/get_nodes.py +8 -2
- swift/cli/info.py +154 -14
- swift/cli/manage_shard_ranges.py +705 -37
- swift-2.23.3.data/scripts/swift-oldies → swift/cli/oldies.py +25 -14
- swift-2.23.3.data/scripts/swift-orphans → swift/cli/orphans.py +7 -3
- swift/cli/recon.py +196 -67
- swift-2.23.3.data/scripts/swift-recon-cron → swift/cli/recon_cron.py +17 -20
- swift-2.23.3.data/scripts/swift-reconciler-enqueue → swift/cli/reconciler_enqueue.py +2 -3
- swift/cli/relinker.py +807 -126
- swift/cli/reload.py +135 -0
- swift/cli/ringbuilder.py +217 -20
- swift/cli/ringcomposer.py +0 -1
- swift/cli/shard-info.py +4 -3
- swift/common/base_storage_server.py +9 -20
- swift/common/bufferedhttp.py +48 -74
- swift/common/constraints.py +20 -15
- swift/common/container_sync_realms.py +9 -11
- swift/common/daemon.py +25 -8
- swift/common/db.py +195 -128
- swift/common/db_auditor.py +168 -0
- swift/common/db_replicator.py +95 -55
- swift/common/digest.py +141 -0
- swift/common/direct_client.py +144 -33
- swift/common/error_limiter.py +93 -0
- swift/common/exceptions.py +25 -1
- swift/common/header_key_dict.py +2 -9
- swift/common/http_protocol.py +373 -0
- swift/common/internal_client.py +129 -59
- swift/common/linkat.py +3 -4
- swift/common/manager.py +284 -67
- swift/common/memcached.py +390 -145
- swift/common/middleware/__init__.py +4 -0
- swift/common/middleware/account_quotas.py +211 -46
- swift/common/middleware/acl.py +3 -8
- swift/common/middleware/backend_ratelimit.py +230 -0
- swift/common/middleware/bulk.py +22 -34
- swift/common/middleware/catch_errors.py +1 -3
- swift/common/middleware/cname_lookup.py +6 -11
- swift/common/middleware/container_quotas.py +1 -1
- swift/common/middleware/container_sync.py +39 -17
- swift/common/middleware/copy.py +12 -0
- swift/common/middleware/crossdomain.py +22 -9
- swift/common/middleware/crypto/__init__.py +2 -1
- swift/common/middleware/crypto/crypto_utils.py +11 -15
- swift/common/middleware/crypto/decrypter.py +28 -11
- swift/common/middleware/crypto/encrypter.py +12 -17
- swift/common/middleware/crypto/keymaster.py +8 -15
- swift/common/middleware/crypto/kms_keymaster.py +2 -1
- swift/common/middleware/dlo.py +15 -11
- swift/common/middleware/domain_remap.py +5 -4
- swift/common/middleware/etag_quoter.py +128 -0
- swift/common/middleware/formpost.py +73 -70
- swift/common/middleware/gatekeeper.py +8 -1
- swift/common/middleware/keystoneauth.py +33 -3
- swift/common/middleware/list_endpoints.py +4 -4
- swift/common/middleware/listing_formats.py +85 -49
- swift/common/middleware/memcache.py +4 -95
- swift/common/middleware/name_check.py +3 -2
- swift/common/middleware/proxy_logging.py +160 -92
- swift/common/middleware/ratelimit.py +17 -10
- swift/common/middleware/read_only.py +6 -4
- swift/common/middleware/recon.py +59 -22
- swift/common/middleware/s3api/acl_handlers.py +25 -3
- swift/common/middleware/s3api/acl_utils.py +6 -1
- swift/common/middleware/s3api/controllers/__init__.py +6 -0
- swift/common/middleware/s3api/controllers/acl.py +3 -2
- swift/common/middleware/s3api/controllers/bucket.py +242 -137
- swift/common/middleware/s3api/controllers/logging.py +2 -2
- swift/common/middleware/s3api/controllers/multi_delete.py +43 -20
- swift/common/middleware/s3api/controllers/multi_upload.py +219 -133
- swift/common/middleware/s3api/controllers/obj.py +112 -8
- swift/common/middleware/s3api/controllers/object_lock.py +44 -0
- swift/common/middleware/s3api/controllers/s3_acl.py +2 -2
- swift/common/middleware/s3api/controllers/tagging.py +57 -0
- swift/common/middleware/s3api/controllers/versioning.py +36 -7
- swift/common/middleware/s3api/etree.py +22 -9
- swift/common/middleware/s3api/exception.py +0 -4
- swift/common/middleware/s3api/s3api.py +113 -41
- swift/common/middleware/s3api/s3request.py +384 -218
- swift/common/middleware/s3api/s3response.py +126 -23
- swift/common/middleware/s3api/s3token.py +16 -17
- swift/common/middleware/s3api/schema/delete.rng +1 -1
- swift/common/middleware/s3api/subresource.py +7 -10
- swift/common/middleware/s3api/utils.py +27 -10
- swift/common/middleware/slo.py +665 -358
- swift/common/middleware/staticweb.py +64 -37
- swift/common/middleware/symlink.py +51 -18
- swift/common/middleware/tempauth.py +76 -58
- swift/common/middleware/tempurl.py +191 -173
- swift/common/middleware/versioned_writes/__init__.py +51 -0
- swift/common/middleware/{versioned_writes.py → versioned_writes/legacy.py} +27 -26
- swift/common/middleware/versioned_writes/object_versioning.py +1482 -0
- swift/common/middleware/x_profile/exceptions.py +1 -4
- swift/common/middleware/x_profile/html_viewer.py +18 -19
- swift/common/middleware/x_profile/profile_model.py +1 -2
- swift/common/middleware/xprofile.py +10 -10
- swift-2.23.3.data/scripts/swift-container-server → swift/common/recon.py +13 -8
- swift/common/registry.py +147 -0
- swift/common/request_helpers.py +324 -57
- swift/common/ring/builder.py +67 -25
- swift/common/ring/composite_builder.py +1 -1
- swift/common/ring/ring.py +177 -51
- swift/common/ring/utils.py +1 -1
- swift/common/splice.py +10 -6
- swift/common/statsd_client.py +205 -0
- swift/common/storage_policy.py +49 -44
- swift/common/swob.py +86 -102
- swift/common/{utils.py → utils/__init__.py} +2163 -2772
- swift/common/utils/base.py +131 -0
- swift/common/utils/config.py +433 -0
- swift/common/utils/ipaddrs.py +256 -0
- swift/common/utils/libc.py +345 -0
- swift/common/utils/logs.py +859 -0
- swift/common/utils/timestamp.py +412 -0
- swift/common/wsgi.py +553 -535
- swift/container/auditor.py +14 -100
- swift/container/backend.py +490 -231
- swift/container/reconciler.py +126 -37
- swift/container/replicator.py +96 -22
- swift/container/server.py +358 -165
- swift/container/sharder.py +1540 -684
- swift/container/sync.py +94 -88
- swift/container/updater.py +53 -32
- swift/obj/auditor.py +153 -35
- swift/obj/diskfile.py +466 -217
- swift/obj/expirer.py +406 -124
- swift/obj/mem_diskfile.py +7 -4
- swift/obj/mem_server.py +1 -0
- swift/obj/reconstructor.py +523 -262
- swift/obj/replicator.py +249 -188
- swift/obj/server.py +207 -122
- swift/obj/ssync_receiver.py +145 -85
- swift/obj/ssync_sender.py +113 -54
- swift/obj/updater.py +652 -139
- swift/obj/watchers/__init__.py +0 -0
- swift/obj/watchers/dark_data.py +213 -0
- swift/proxy/controllers/account.py +11 -11
- swift/proxy/controllers/base.py +848 -604
- swift/proxy/controllers/container.py +433 -92
- swift/proxy/controllers/info.py +3 -2
- swift/proxy/controllers/obj.py +1000 -489
- swift/proxy/server.py +185 -112
- {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/AUTHORS +58 -11
- {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/METADATA +51 -56
- swift-2.35.0.dist-info/RECORD +201 -0
- {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/WHEEL +1 -1
- {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/entry_points.txt +43 -0
- swift-2.35.0.dist-info/pbr.json +1 -0
- swift/locale/de/LC_MESSAGES/swift.po +0 -1216
- swift/locale/en_GB/LC_MESSAGES/swift.po +0 -1207
- swift/locale/es/LC_MESSAGES/swift.po +0 -1085
- swift/locale/fr/LC_MESSAGES/swift.po +0 -909
- swift/locale/it/LC_MESSAGES/swift.po +0 -894
- swift/locale/ja/LC_MESSAGES/swift.po +0 -965
- swift/locale/ko_KR/LC_MESSAGES/swift.po +0 -964
- swift/locale/pt_BR/LC_MESSAGES/swift.po +0 -881
- swift/locale/ru/LC_MESSAGES/swift.po +0 -891
- swift/locale/tr_TR/LC_MESSAGES/swift.po +0 -832
- swift/locale/zh_CN/LC_MESSAGES/swift.po +0 -833
- swift/locale/zh_TW/LC_MESSAGES/swift.po +0 -838
- swift-2.23.3.data/scripts/swift-account-auditor +0 -23
- swift-2.23.3.data/scripts/swift-account-info +0 -51
- swift-2.23.3.data/scripts/swift-account-reaper +0 -23
- swift-2.23.3.data/scripts/swift-account-replicator +0 -34
- swift-2.23.3.data/scripts/swift-account-server +0 -23
- swift-2.23.3.data/scripts/swift-container-auditor +0 -23
- swift-2.23.3.data/scripts/swift-container-info +0 -55
- swift-2.23.3.data/scripts/swift-container-reconciler +0 -21
- swift-2.23.3.data/scripts/swift-container-replicator +0 -34
- swift-2.23.3.data/scripts/swift-container-sharder +0 -37
- swift-2.23.3.data/scripts/swift-container-sync +0 -23
- swift-2.23.3.data/scripts/swift-container-updater +0 -23
- swift-2.23.3.data/scripts/swift-dispersion-report +0 -24
- swift-2.23.3.data/scripts/swift-form-signature +0 -20
- swift-2.23.3.data/scripts/swift-init +0 -119
- swift-2.23.3.data/scripts/swift-object-auditor +0 -29
- swift-2.23.3.data/scripts/swift-object-expirer +0 -33
- swift-2.23.3.data/scripts/swift-object-info +0 -60
- swift-2.23.3.data/scripts/swift-object-reconstructor +0 -33
- swift-2.23.3.data/scripts/swift-object-relinker +0 -41
- swift-2.23.3.data/scripts/swift-object-replicator +0 -37
- swift-2.23.3.data/scripts/swift-object-server +0 -27
- swift-2.23.3.data/scripts/swift-object-updater +0 -23
- swift-2.23.3.data/scripts/swift-proxy-server +0 -23
- swift-2.23.3.data/scripts/swift-recon +0 -24
- swift-2.23.3.data/scripts/swift-ring-builder +0 -24
- swift-2.23.3.data/scripts/swift-ring-builder-analyzer +0 -22
- swift-2.23.3.data/scripts/swift-ring-composer +0 -22
- swift-2.23.3.dist-info/RECORD +0 -220
- swift-2.23.3.dist-info/pbr.json +0 -1
- {swift-2.23.3.dist-info → swift-2.35.0.dist-info}/LICENSE +0 -0
- {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)
|