swift 2.23.2__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.2.data/scripts/swift-account-audit → swift/cli/account_audit.py +23 -13
- swift-2.23.2.data/scripts/swift-config → swift/cli/config.py +2 -2
- swift/cli/container_deleter.py +5 -11
- swift-2.23.2.data/scripts/swift-dispersion-populate → swift/cli/dispersion_populate.py +8 -7
- swift/cli/dispersion_report.py +10 -9
- swift-2.23.2.data/scripts/swift-drive-audit → swift/cli/drive_audit.py +63 -21
- swift/cli/form_signature.py +3 -7
- swift-2.23.2.data/scripts/swift-get-nodes → swift/cli/get_nodes.py +8 -2
- swift/cli/info.py +183 -29
- swift/cli/manage_shard_ranges.py +708 -37
- swift-2.23.2.data/scripts/swift-oldies → swift/cli/oldies.py +25 -14
- swift-2.23.2.data/scripts/swift-orphans → swift/cli/orphans.py +7 -3
- swift/cli/recon.py +196 -67
- swift-2.23.2.data/scripts/swift-recon-cron → swift/cli/recon_cron.py +17 -20
- swift-2.23.2.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 +198 -127
- 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 +396 -147
- 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 -81
- 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 +52 -19
- swift/common/middleware/tempauth.py +76 -58
- swift/common/middleware/tempurl.py +192 -174
- 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.2.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} +2191 -2762
- 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 +555 -536
- swift/container/auditor.py +14 -100
- swift/container/backend.py +552 -227
- swift/container/reconciler.py +126 -37
- swift/container/replicator.py +96 -22
- swift/container/server.py +397 -176
- swift/container/sharder.py +1580 -639
- 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 +213 -122
- swift/obj/ssync_receiver.py +145 -85
- swift/obj/ssync_sender.py +113 -54
- swift/obj/updater.py +653 -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 +452 -86
- swift/proxy/controllers/info.py +3 -2
- swift/proxy/controllers/obj.py +1009 -490
- swift/proxy/server.py +185 -112
- swift-2.35.0.dist-info/AUTHORS +501 -0
- swift-2.35.0.dist-info/LICENSE +202 -0
- {swift-2.23.2.dist-info → swift-2.35.0.dist-info}/METADATA +52 -61
- swift-2.35.0.dist-info/RECORD +201 -0
- {swift-2.23.2.dist-info → swift-2.35.0.dist-info}/WHEEL +1 -1
- {swift-2.23.2.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.2.data/scripts/swift-account-auditor +0 -23
- swift-2.23.2.data/scripts/swift-account-info +0 -51
- swift-2.23.2.data/scripts/swift-account-reaper +0 -23
- swift-2.23.2.data/scripts/swift-account-replicator +0 -34
- swift-2.23.2.data/scripts/swift-account-server +0 -23
- swift-2.23.2.data/scripts/swift-container-auditor +0 -23
- swift-2.23.2.data/scripts/swift-container-info +0 -51
- swift-2.23.2.data/scripts/swift-container-reconciler +0 -21
- swift-2.23.2.data/scripts/swift-container-replicator +0 -34
- swift-2.23.2.data/scripts/swift-container-sharder +0 -33
- swift-2.23.2.data/scripts/swift-container-sync +0 -23
- swift-2.23.2.data/scripts/swift-container-updater +0 -23
- swift-2.23.2.data/scripts/swift-dispersion-report +0 -24
- swift-2.23.2.data/scripts/swift-form-signature +0 -20
- swift-2.23.2.data/scripts/swift-init +0 -119
- swift-2.23.2.data/scripts/swift-object-auditor +0 -29
- swift-2.23.2.data/scripts/swift-object-expirer +0 -33
- swift-2.23.2.data/scripts/swift-object-info +0 -60
- swift-2.23.2.data/scripts/swift-object-reconstructor +0 -33
- swift-2.23.2.data/scripts/swift-object-relinker +0 -41
- swift-2.23.2.data/scripts/swift-object-replicator +0 -37
- swift-2.23.2.data/scripts/swift-object-server +0 -27
- swift-2.23.2.data/scripts/swift-object-updater +0 -23
- swift-2.23.2.data/scripts/swift-proxy-server +0 -23
- swift-2.23.2.data/scripts/swift-recon +0 -24
- swift-2.23.2.data/scripts/swift-ring-builder +0 -24
- swift-2.23.2.data/scripts/swift-ring-builder-analyzer +0 -22
- swift-2.23.2.data/scripts/swift-ring-composer +0 -22
- swift-2.23.2.dist-info/DESCRIPTION.rst +0 -166
- swift-2.23.2.dist-info/RECORD +0 -220
- swift-2.23.2.dist-info/metadata.json +0 -1
- swift-2.23.2.dist-info/pbr.json +0 -1
- {swift-2.23.2.dist-info → swift-2.35.0.dist-info}/top_level.txt +0 -0
File without changes
|
@@ -0,0 +1,213 @@
|
|
1
|
+
# Copyright (c) 2019 OpenStack Foundation
|
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
|
+
# This is an audit watcher that manages the dark data in the cluster.
|
18
|
+
# Since the API for audit watchers is intended to use external plugins,
|
19
|
+
# this code is invoked as if it were external: through load_pkg_resources().
|
20
|
+
# Our setup.py comes pre-configured for convenience, but the operator has
|
21
|
+
# to enable this watcher honestly by additing DarkDataWatcher to watchers=
|
22
|
+
# in object-server.conf. The default is off, as if this does not exist.
|
23
|
+
# Which is for the best, because of a large performance impact of this.
|
24
|
+
#
|
25
|
+
|
26
|
+
"""
|
27
|
+
The name of "Dark Data" refers to the scientific hypothesis of Dark Matter,
|
28
|
+
which supposes that the universe contains a lot of matter than we cannot
|
29
|
+
observe. The Dark Data in Swift is the name of objects that are not
|
30
|
+
accounted in the containers.
|
31
|
+
|
32
|
+
The experience of running large scale clusters suggests that Swift does
|
33
|
+
not have any particular bugs that trigger creation of dark data. So,
|
34
|
+
this is an excercise in writing watchers, with a plausible function.
|
35
|
+
|
36
|
+
When enabled, Dark Data watcher definitely drags down the cluster's overall
|
37
|
+
performance. Of course, the load increase can be mitigated as usual,
|
38
|
+
but at the expense of the total time taken by the pass of auditor.
|
39
|
+
|
40
|
+
Because the watcher only deems an object dark when all container
|
41
|
+
servers agree, it will silently fail to detect anything if even one
|
42
|
+
of container servers in the ring is down or unreacheable. This is
|
43
|
+
done in the interest of operators who run with action=delete.
|
44
|
+
|
45
|
+
If a container is sharded, there is a small edgecase where an object row could
|
46
|
+
be misplaced. So it is recommended to always start with action=log, before
|
47
|
+
your confident to run action=delete.
|
48
|
+
|
49
|
+
Finally, keep in mind that Dark Data watcher needs the container
|
50
|
+
ring to operate, but runs on an object node. This can come up if
|
51
|
+
cluster has nodes separated by function.
|
52
|
+
"""
|
53
|
+
|
54
|
+
import os
|
55
|
+
import random
|
56
|
+
import shutil
|
57
|
+
import time
|
58
|
+
|
59
|
+
from eventlet import Timeout
|
60
|
+
|
61
|
+
from swift.common.direct_client import direct_get_container
|
62
|
+
from swift.common.exceptions import ClientException, QuarantineRequest
|
63
|
+
from swift.common.ring import Ring
|
64
|
+
from swift.common.utils import split_path, Namespace, Timestamp
|
65
|
+
|
66
|
+
|
67
|
+
class ContainerError(Exception):
|
68
|
+
pass
|
69
|
+
|
70
|
+
|
71
|
+
class DarkDataWatcher(object):
|
72
|
+
def __init__(self, conf, logger):
|
73
|
+
|
74
|
+
self.logger = logger
|
75
|
+
|
76
|
+
swift_dir = '/etc/swift'
|
77
|
+
self.container_ring = Ring(swift_dir, ring_name='container')
|
78
|
+
self.dark_data_policy = conf.get('action')
|
79
|
+
if self.dark_data_policy not in ['log', 'delete', 'quarantine']:
|
80
|
+
if self.dark_data_policy is not None:
|
81
|
+
self.logger.warning(
|
82
|
+
"Dark data action %r unknown, defaults to action = 'log'" %
|
83
|
+
(self.dark_data_policy,))
|
84
|
+
self.dark_data_policy = 'log'
|
85
|
+
self.grace_age = int(conf.get('grace_age', 604800))
|
86
|
+
|
87
|
+
def start(self, audit_type, **other_kwargs):
|
88
|
+
self.is_zbf = audit_type == 'ZBF'
|
89
|
+
self.tot_unknown = 0
|
90
|
+
self.tot_dark = 0
|
91
|
+
self.tot_okay = 0
|
92
|
+
|
93
|
+
def policy_based_object_handling(self, data_file_path, metadata):
|
94
|
+
obj_path = metadata['name']
|
95
|
+
|
96
|
+
if self.dark_data_policy == "quarantine":
|
97
|
+
self.logger.info("quarantining dark data %s" % obj_path)
|
98
|
+
raise QuarantineRequest
|
99
|
+
elif self.dark_data_policy == "log":
|
100
|
+
self.logger.info("reporting dark data %s" % obj_path)
|
101
|
+
elif self.dark_data_policy == "delete":
|
102
|
+
obj_dir = os.path.dirname(data_file_path)
|
103
|
+
self.logger.info("deleting dark data %s" % obj_dir)
|
104
|
+
shutil.rmtree(obj_dir)
|
105
|
+
|
106
|
+
def see_object(self, object_metadata, data_file_path, **other_kwargs):
|
107
|
+
|
108
|
+
# No point in loading the container servers with unnecessary requests.
|
109
|
+
if self.is_zbf:
|
110
|
+
return
|
111
|
+
|
112
|
+
put_tstr = object_metadata['X-Timestamp']
|
113
|
+
if float(Timestamp(put_tstr)) + self.grace_age >= time.time():
|
114
|
+
# We can add "tot_new" if lumping these with the good objects
|
115
|
+
# ever bothers anyone.
|
116
|
+
self.tot_okay += 1
|
117
|
+
return
|
118
|
+
|
119
|
+
obj_path = object_metadata['name']
|
120
|
+
try:
|
121
|
+
obj_info = get_info_1(self.container_ring, obj_path)
|
122
|
+
except ContainerError:
|
123
|
+
self.tot_unknown += 1
|
124
|
+
return
|
125
|
+
|
126
|
+
if obj_info is None:
|
127
|
+
self.tot_dark += 1
|
128
|
+
self.policy_based_object_handling(data_file_path, object_metadata)
|
129
|
+
else:
|
130
|
+
# OK, object is there, but in the future we might want to verify
|
131
|
+
# more. Watch out for versioned objects, EC, and all that.
|
132
|
+
self.tot_okay += 1
|
133
|
+
|
134
|
+
def end(self, **other_kwargs):
|
135
|
+
if self.is_zbf:
|
136
|
+
return
|
137
|
+
self.logger.info("total unknown %d ok %d dark %d" %
|
138
|
+
(self.tot_unknown, self.tot_okay, self.tot_dark))
|
139
|
+
|
140
|
+
|
141
|
+
#
|
142
|
+
# Get the information for 1 object from container server
|
143
|
+
#
|
144
|
+
def get_info_1(container_ring, obj_path):
|
145
|
+
|
146
|
+
path_comps = split_path(obj_path, 1, 3, True)
|
147
|
+
account_name = path_comps[0]
|
148
|
+
container_name = path_comps[1]
|
149
|
+
obj_name = path_comps[2]
|
150
|
+
visited = set()
|
151
|
+
|
152
|
+
def check_container(account_name, container_name):
|
153
|
+
record_type = 'auto'
|
154
|
+
if (account_name, container_name) in visited:
|
155
|
+
# Already queried; So we have a last ditch effort and specifically
|
156
|
+
# ask for object data as this could be pointing back to the root
|
157
|
+
# If the container doesn't have objects then this will return
|
158
|
+
# no objects and break the loop.
|
159
|
+
record_type = 'object'
|
160
|
+
else:
|
161
|
+
visited.add((account_name, container_name))
|
162
|
+
|
163
|
+
container_part, container_nodes = \
|
164
|
+
container_ring.get_nodes(account_name, container_name)
|
165
|
+
if not container_nodes:
|
166
|
+
raise ContainerError()
|
167
|
+
|
168
|
+
# Perhaps we should do something about the way we select the container
|
169
|
+
# nodes. For now we just shuffle. It spreads the load, but it does not
|
170
|
+
# improve upon the the case when some nodes are down, so auditor slows
|
171
|
+
# to a crawl (if this plugin is enabled).
|
172
|
+
random.shuffle(container_nodes)
|
173
|
+
|
174
|
+
err_flag = 0
|
175
|
+
shards = set()
|
176
|
+
for node in container_nodes:
|
177
|
+
try:
|
178
|
+
# The prefix+limit trick is used when a traditional listing
|
179
|
+
# is returned, while includes is there for shards.
|
180
|
+
# See the how GET routes it in swift/container/server.py.
|
181
|
+
headers, objs_or_shards = direct_get_container(
|
182
|
+
node, container_part, account_name, container_name,
|
183
|
+
prefix=obj_name, limit=1,
|
184
|
+
extra_params={'includes': obj_name, 'states': 'listing'},
|
185
|
+
headers={'X-Backend-Record-Type': record_type})
|
186
|
+
except (ClientException, Timeout):
|
187
|
+
# Something is wrong with that server, treat as an error.
|
188
|
+
err_flag += 1
|
189
|
+
continue
|
190
|
+
if headers.get('X-Backend-Record-Type') == 'shard':
|
191
|
+
# When using includes=obj_name, we don't need to anything
|
192
|
+
# like find_shard_range(obj_name, ... objs_or_shards).
|
193
|
+
if len(objs_or_shards) != 0:
|
194
|
+
namespace = Namespace(objs_or_shards[0]['name'],
|
195
|
+
objs_or_shards[0]['lower'],
|
196
|
+
objs_or_shards[0]['upper'])
|
197
|
+
shards.add((namespace.account, namespace.container))
|
198
|
+
continue
|
199
|
+
if objs_or_shards and objs_or_shards[0]['name'] == obj_name:
|
200
|
+
return objs_or_shards[0]
|
201
|
+
|
202
|
+
# If we got back some shards, recurse
|
203
|
+
for account_name, container_name in shards:
|
204
|
+
res = check_container(account_name, container_name)
|
205
|
+
if res:
|
206
|
+
return res
|
207
|
+
|
208
|
+
# We only report the object as dark if all known servers agree to it.
|
209
|
+
if err_flag:
|
210
|
+
raise ContainerError()
|
211
|
+
return None
|
212
|
+
|
213
|
+
return check_container(account_name, container_name)
|
@@ -13,9 +13,7 @@
|
|
13
13
|
# See the License for the specific language governing permissions and
|
14
14
|
# limitations under the License.
|
15
15
|
|
16
|
-
from
|
17
|
-
|
18
|
-
from swift import gettext_ as _
|
16
|
+
from urllib.parse import unquote
|
19
17
|
|
20
18
|
from swift.account.utils import account_listing_response
|
21
19
|
from swift.common.middleware.acl import parse_acl, format_acl
|
@@ -23,7 +21,7 @@ from swift.common.utils import public
|
|
23
21
|
from swift.common.constraints import check_metadata
|
24
22
|
from swift.common.http import HTTP_NOT_FOUND, HTTP_GONE
|
25
23
|
from swift.proxy.controllers.base import Controller, clear_info_cache, \
|
26
|
-
set_info_cache
|
24
|
+
set_info_cache, NodeIter
|
27
25
|
from swift.common.middleware import listing_formats
|
28
26
|
from swift.common.swob import HTTPBadRequest, HTTPMethodNotAllowed
|
29
27
|
from swift.common.request_helpers import get_sys_meta_prefix
|
@@ -64,13 +62,15 @@ class AccountController(Controller):
|
|
64
62
|
|
65
63
|
partition = self.app.account_ring.get_part(self.account_name)
|
66
64
|
concurrency = self.app.account_ring.replica_count \
|
67
|
-
if self.app.concurrent_gets else 1
|
68
|
-
node_iter =
|
65
|
+
if self.app.get_policy_options(None).concurrent_gets else 1
|
66
|
+
node_iter = NodeIter(
|
67
|
+
'account', self.app, self.app.account_ring, partition,
|
68
|
+
self.logger, req)
|
69
69
|
params = req.params
|
70
70
|
params['format'] = 'json'
|
71
71
|
req.params = params
|
72
72
|
resp = self.GETorHEAD_base(
|
73
|
-
req,
|
73
|
+
req, 'Account', node_iter, partition,
|
74
74
|
req.swift_entity_path.rstrip('/'), concurrency)
|
75
75
|
if resp.status_int == HTTP_NOT_FOUND:
|
76
76
|
if resp.headers.get('X-Account-Status', '').lower() == 'deleted':
|
@@ -97,7 +97,7 @@ class AccountController(Controller):
|
|
97
97
|
# up-to-date information for the account.
|
98
98
|
resp.headers['X-Backend-Recheck-Account-Existence'] = str(
|
99
99
|
self.app.recheck_account_existence)
|
100
|
-
set_info_cache(
|
100
|
+
set_info_cache(req.environ, self.account_name, None, resp)
|
101
101
|
|
102
102
|
if req.environ.get('swift_owner'):
|
103
103
|
self.add_acls_from_sys_metadata(resp)
|
@@ -125,7 +125,7 @@ class AccountController(Controller):
|
|
125
125
|
account_partition, accounts = \
|
126
126
|
self.app.account_ring.get_nodes(self.account_name)
|
127
127
|
headers = self.generate_request_headers(req, transfer=True)
|
128
|
-
clear_info_cache(
|
128
|
+
clear_info_cache(req.environ, self.account_name)
|
129
129
|
resp = self.make_requests(
|
130
130
|
req, self.app.account_ring, account_partition, 'PUT',
|
131
131
|
req.swift_entity_path, [headers] * len(accounts))
|
@@ -147,7 +147,7 @@ class AccountController(Controller):
|
|
147
147
|
account_partition, accounts = \
|
148
148
|
self.app.account_ring.get_nodes(self.account_name)
|
149
149
|
headers = self.generate_request_headers(req, transfer=True)
|
150
|
-
clear_info_cache(
|
150
|
+
clear_info_cache(req.environ, self.account_name)
|
151
151
|
resp = self.make_requests(
|
152
152
|
req, self.app.account_ring, account_partition, 'POST',
|
153
153
|
req.swift_entity_path, [headers] * len(accounts))
|
@@ -174,7 +174,7 @@ class AccountController(Controller):
|
|
174
174
|
account_partition, accounts = \
|
175
175
|
self.app.account_ring.get_nodes(self.account_name)
|
176
176
|
headers = self.generate_request_headers(req)
|
177
|
-
clear_info_cache(
|
177
|
+
clear_info_cache(req.environ, self.account_name)
|
178
178
|
resp = self.make_requests(
|
179
179
|
req, self.app.account_ring, account_partition, 'DELETE',
|
180
180
|
req.swift_entity_path, [headers] * len(accounts))
|