swift 2.31.1__py2.py3-none-any.whl → 2.32.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. swift/cli/info.py +9 -2
  2. swift/cli/ringbuilder.py +5 -1
  3. swift/common/container_sync_realms.py +6 -7
  4. swift/common/daemon.py +7 -3
  5. swift/common/db.py +22 -7
  6. swift/common/db_replicator.py +19 -20
  7. swift/common/direct_client.py +63 -14
  8. swift/common/internal_client.py +24 -3
  9. swift/common/manager.py +43 -44
  10. swift/common/memcached.py +168 -74
  11. swift/common/middleware/__init__.py +4 -0
  12. swift/common/middleware/account_quotas.py +98 -40
  13. swift/common/middleware/backend_ratelimit.py +6 -4
  14. swift/common/middleware/crossdomain.py +21 -8
  15. swift/common/middleware/listing_formats.py +26 -38
  16. swift/common/middleware/proxy_logging.py +12 -9
  17. swift/common/middleware/s3api/controllers/bucket.py +8 -2
  18. swift/common/middleware/s3api/s3api.py +9 -4
  19. swift/common/middleware/s3api/s3request.py +32 -24
  20. swift/common/middleware/s3api/s3response.py +10 -1
  21. swift/common/middleware/tempauth.py +9 -10
  22. swift/common/middleware/versioned_writes/__init__.py +0 -3
  23. swift/common/middleware/versioned_writes/object_versioning.py +22 -5
  24. swift/common/middleware/x_profile/html_viewer.py +1 -1
  25. swift/common/middleware/xprofile.py +5 -0
  26. swift/common/request_helpers.py +1 -2
  27. swift/common/ring/ring.py +22 -19
  28. swift/common/swob.py +2 -1
  29. swift/common/{utils.py → utils/__init__.py} +610 -1146
  30. swift/common/utils/ipaddrs.py +256 -0
  31. swift/common/utils/libc.py +345 -0
  32. swift/common/utils/timestamp.py +399 -0
  33. swift/common/wsgi.py +70 -39
  34. swift/container/backend.py +106 -38
  35. swift/container/server.py +11 -2
  36. swift/container/sharder.py +34 -15
  37. swift/locale/de/LC_MESSAGES/swift.po +1 -320
  38. swift/locale/en_GB/LC_MESSAGES/swift.po +1 -347
  39. swift/locale/es/LC_MESSAGES/swift.po +1 -279
  40. swift/locale/fr/LC_MESSAGES/swift.po +1 -209
  41. swift/locale/it/LC_MESSAGES/swift.po +1 -207
  42. swift/locale/ja/LC_MESSAGES/swift.po +2 -278
  43. swift/locale/ko_KR/LC_MESSAGES/swift.po +3 -303
  44. swift/locale/pt_BR/LC_MESSAGES/swift.po +1 -204
  45. swift/locale/ru/LC_MESSAGES/swift.po +1 -203
  46. swift/locale/tr_TR/LC_MESSAGES/swift.po +1 -192
  47. swift/locale/zh_CN/LC_MESSAGES/swift.po +1 -192
  48. swift/locale/zh_TW/LC_MESSAGES/swift.po +1 -193
  49. swift/obj/diskfile.py +19 -6
  50. swift/obj/server.py +20 -6
  51. swift/obj/ssync_receiver.py +19 -9
  52. swift/obj/ssync_sender.py +10 -10
  53. swift/proxy/controllers/account.py +7 -7
  54. swift/proxy/controllers/base.py +374 -366
  55. swift/proxy/controllers/container.py +112 -53
  56. swift/proxy/controllers/obj.py +254 -390
  57. swift/proxy/server.py +3 -8
  58. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-server +1 -1
  59. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-server +1 -1
  60. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-drive-audit +45 -14
  61. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-server +1 -1
  62. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-proxy-server +1 -1
  63. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/AUTHORS +4 -0
  64. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/METADATA +32 -35
  65. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/RECORD +103 -100
  66. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/WHEEL +1 -1
  67. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/entry_points.txt +0 -1
  68. swift-2.32.1.dist-info/pbr.json +1 -0
  69. swift-2.31.1.dist-info/pbr.json +0 -1
  70. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-audit +0 -0
  71. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-auditor +0 -0
  72. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-info +0 -0
  73. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-reaper +0 -0
  74. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-account-replicator +0 -0
  75. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-config +0 -0
  76. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-auditor +0 -0
  77. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-info +0 -0
  78. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-reconciler +0 -0
  79. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-replicator +0 -0
  80. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-sharder +0 -0
  81. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-sync +0 -0
  82. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-container-updater +0 -0
  83. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-dispersion-populate +0 -0
  84. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-dispersion-report +0 -0
  85. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-form-signature +0 -0
  86. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-get-nodes +0 -0
  87. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-init +0 -0
  88. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-auditor +0 -0
  89. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-expirer +0 -0
  90. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-info +0 -0
  91. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-reconstructor +0 -0
  92. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-relinker +0 -0
  93. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-replicator +0 -0
  94. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-object-updater +0 -0
  95. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-oldies +0 -0
  96. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-orphans +0 -0
  97. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-recon +0 -0
  98. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-recon-cron +0 -0
  99. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-reconciler-enqueue +0 -0
  100. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-builder +0 -0
  101. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-builder-analyzer +0 -0
  102. {swift-2.31.1.data → swift-2.32.1.data}/scripts/swift-ring-composer +0 -0
  103. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/LICENSE +0 -0
  104. {swift-2.31.1.dist-info → swift-2.32.1.dist-info}/top_level.txt +0 -0
@@ -9,7 +9,7 @@ msgid ""
9
9
  msgstr ""
10
10
  "Project-Id-Version: swift VERSION\n"
11
11
  "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n"
12
- "POT-Creation-Date: 2022-05-27 18:57+0000\n"
12
+ "POT-Creation-Date: 2023-06-27 13:31+0000\n"
13
13
  "MIME-Version: 1.0\n"
14
14
  "Content-Type: text/plain; charset=UTF-8\n"
15
15
  "Content-Transfer-Encoding: 8bit\n"
@@ -21,40 +21,6 @@ msgstr ""
21
21
  "X-Generator: Zanata 4.3.3\n"
22
22
  "Language-Team: Chinese (China)\n"
23
23
 
24
- msgid ""
25
- "\n"
26
- "user quit"
27
- msgstr ""
28
- "\n"
29
- "用户退出"
30
-
31
- #, python-format
32
- msgid "%(success)s successes, %(failure)s failures"
33
- msgstr "%(success)s成功,%(failure)s失败"
34
-
35
- #, python-format
36
- msgid "%s already started..."
37
- msgstr "%s已启动..."
38
-
39
- #, python-format
40
- msgid "%s does not exist"
41
- msgstr "%s不存在"
42
-
43
- #, python-format
44
- msgid "%s: Connection reset by peer"
45
- msgstr "%s:已由同级重置连接"
46
-
47
- #, python-format
48
- msgid ""
49
- "Attempted to replicate %(count)d dbs in %(time).5f seconds (%(rate).5f/s)"
50
- msgstr "%(time).5f seconds (%(rate).5f/s)尝试复制%(count)d dbs"
51
-
52
- msgid "Beginning replication run"
53
- msgstr "开始运行复制"
54
-
55
- msgid "Broker error trying to rollback locked connection"
56
- msgstr "服务器错误并尝试去回滚已经锁住的链接"
57
-
58
24
  #, python-format
59
25
  msgid "Can not access the file %s."
60
26
  msgstr "无法访问文件%s"
@@ -63,45 +29,10 @@ msgstr "无法访问文件%s"
63
29
  msgid "Can not load profile data from %s."
64
30
  msgstr "无法从%s下载分析数据"
65
31
 
66
- msgid "Connection refused"
67
- msgstr "连接被拒绝"
68
-
69
- msgid "Connection timeout"
70
- msgstr "连接超时"
71
-
72
32
  #, python-format
73
33
  msgid "Data download error: %s"
74
34
  msgstr "数据下载错误:%s"
75
35
 
76
- msgid "ERROR Failed to get my own IPs?"
77
- msgstr "错误 无法获得我方IPs?"
78
-
79
- #, python-format
80
- msgid "ERROR Remote drive not mounted %s"
81
- msgstr "错误 远程驱动器无法挂载 %s"
82
-
83
- msgid "ERROR auditing"
84
- msgstr "错误 审计"
85
-
86
- #, python-format
87
- msgid "ERROR reading HTTP response from %s"
88
- msgstr "读取HTTP错误 响应来源%s"
89
-
90
- #, python-format
91
- msgid "ERROR reading db %s"
92
- msgstr "错误 读取db %s"
93
-
94
- #, python-format
95
- msgid "ERROR rsync failed with %(code)s: %(args)s"
96
- msgstr "错误 rsync失败 %(code)s: %(args)s"
97
-
98
- #, python-format
99
- msgid "ERROR syncing %(file)s with node %(node)s"
100
- msgstr "错误 同步 %(file)s 和 节点%(node)s"
101
-
102
- msgid "ERROR trying to replicate"
103
- msgstr "尝试复制时发生错误"
104
-
105
36
  msgid "Error listing devices"
106
37
  msgstr "设备列表时出现错误"
107
38
 
@@ -127,151 +58,29 @@ msgstr "检索recon data时出现错误"
127
58
  msgid "Error: An error occurred"
128
59
  msgstr "错误:一个错误发生了"
129
60
 
130
- msgid "Error: missing config path argument"
131
- msgstr "错误:设置路径信息丢失"
132
-
133
- #, python-format
134
- msgid "Error: unable to locate %s"
135
- msgstr "错误:无法查询到 %s"
136
-
137
61
  #, python-format
138
62
  msgid "Following CNAME chain for %(given_domain)s to %(found_domain)s"
139
63
  msgstr "跟随CNAME链从%(given_domain)s到%(found_domain)s"
140
64
 
141
- msgid "Found configs:"
142
- msgstr "找到配置"
143
-
144
- msgid "Host unreachable"
145
- msgstr "无法连接到主机"
146
-
147
- #, python-format
148
- msgid "Invalid X-Container-Sync-To format %r"
149
- msgstr "无效的X-Container-Sync-To格式%r"
150
-
151
- #, python-format
152
- msgid "Invalid host %r in X-Container-Sync-To"
153
- msgstr "X-Container-Sync-To中无效主机%r"
154
-
155
- #, python-format
156
- msgid "Invalid pending entry %(file)s: %(entry)s"
157
- msgstr "不可用的等待输入%(file)s: %(entry)s"
158
-
159
- #, python-format
160
- msgid ""
161
- "Invalid scheme %r in X-Container-Sync-To, must be \"//\", \"http\", or "
162
- "\"https\"."
163
- msgstr ""
164
- "在X-Container-Sync-To中%r是无效的方案,须为\"//\", \"http\", or \"https\"。"
165
-
166
65
  #, python-format
167
66
  msgid "Mapped %(given_domain)s to %(found_domain)s"
168
67
  msgstr "集合%(given_domain)s到%(found_domain)s"
169
68
 
170
- #, python-format
171
- msgid "No %s running"
172
- msgstr "无%s账号运行"
173
-
174
- #, python-format
175
- msgid "No permission to signal PID %d"
176
- msgstr "无权限发送信号PID%d"
177
-
178
- #, python-format
179
- msgid "No policy with index %s"
180
- msgstr "没有具备索引 %s 的策略"
181
-
182
- #, python-format
183
- msgid "No realm key for %r"
184
- msgstr "%r权限key不存在"
185
-
186
- msgid "Params, queries, and fragments not allowed in X-Container-Sync-To"
187
- msgstr "在X-Container-Sync-To中,变量,查询和碎片不被允许"
188
-
189
- msgid "Path required in X-Container-Sync-To"
190
- msgstr "在X-Container-Sync-To中路径是必须的"
191
-
192
69
  #, python-format
193
70
  msgid "Profiling Error: %s"
194
71
  msgstr "分析代码时出现错误:%s"
195
72
 
196
- #, python-format
197
- msgid "Quarantining DB %s"
198
- msgstr "隔离DB%s"
199
-
200
73
  #, python-format
201
74
  msgid "Ratelimit sleep log: %(sleep)s for %(account)s/%(container)s/%(object)s"
202
75
  msgstr "流量控制休眠日志:%(sleep)s for %(account)s/%(container)s/%(object)s"
203
76
 
204
- #, python-format
205
- msgid "Removed %(remove)d dbs"
206
- msgstr "删除%(remove)d dbs"
207
-
208
- #, python-format
209
- msgid "Removing pid file %(pid_file)s with wrong pid %(pid)d"
210
- msgstr "移除 pid 文件 %(pid_file)s 失败,pid %(pid)d 不正确"
211
-
212
- #, python-format
213
- msgid "Removing pid file %s with invalid pid"
214
- msgstr "正在移除带有无效 pid 的 pid 文件 %s"
215
-
216
- #, python-format
217
- msgid "Removing stale pid file %s"
218
- msgstr "移除原有pid文件%s"
219
-
220
- msgid "Replication run OVER"
221
- msgstr "复制运行结束"
222
-
223
77
  #, python-format
224
78
  msgid "Returning 497 because of blacklisting: %s"
225
79
  msgstr "返回497因为黑名单:%s"
226
80
 
227
- #, python-format
228
- msgid "Running %s once"
229
- msgstr "运行%s一次"
230
-
231
- #, python-format
232
- msgid "Skipping %s as it is not mounted"
233
- msgstr "挂载失败 跳过%s"
234
-
235
- #, python-format
236
- msgid "Starting %s"
237
- msgstr "启动%s"
238
-
239
81
  msgid "The file type are forbidden to access!"
240
82
  msgstr "该文件类型被禁止访问!"
241
83
 
242
- msgid "UNCAUGHT EXCEPTION"
243
- msgstr "未捕获的异常"
244
-
245
- #, python-format
246
- msgid "Unable to locate %s in libc. Leaving as a no-op."
247
- msgstr "无法查询到%s 保留为no-op"
248
-
249
- #, python-format
250
- msgid "Unable to locate config for %s"
251
- msgstr "找不到 %s 的配置"
252
-
253
- msgid ""
254
- "Unable to locate fallocate, posix_fallocate in libc. Leaving as a no-op."
255
- msgstr "无法查询到fallocate, posix_fallocate。保存为no-op"
256
-
257
- #, python-format
258
- msgid "Unable to read config from %s"
259
- msgstr "无法从%s读取设置"
260
-
261
- msgid ""
262
- "WARNING: SSL should only be enabled for testing purposes. Use external SSL "
263
- "termination for a production deployment."
264
- msgstr "警告:SSL仅可以做测试使用。产品部署时请使用外连SSL终端"
265
-
266
- msgid "WARNING: Unable to modify file descriptor limit. Running as non-root?"
267
- msgstr "警告:无法修改文件描述限制。是否按非root运行?"
268
-
269
- msgid "WARNING: Unable to modify max process limit. Running as non-root?"
270
- msgstr "警告:无法修改最大运行极限,是否按非root运行?"
271
-
272
- msgid "WARNING: Unable to modify memory limit. Running as non-root?"
273
- msgstr "警告:无法修改内存极限,是否按非root运行?"
274
-
275
84
  msgid "Warning: Cannot ratelimit without a memcached client"
276
85
  msgstr "警告:缺失缓存客户端 无法控制流量 "
277
86
 
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: swift VERSION\n"
10
10
  "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n"
11
- "POT-Creation-Date: 2022-05-27 18:57+0000\n"
11
+ "POT-Creation-Date: 2023-06-27 13:31+0000\n"
12
12
  "MIME-Version: 1.0\n"
13
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
14
  "Content-Transfer-Encoding: 8bit\n"
@@ -20,40 +20,6 @@ msgstr ""
20
20
  "X-Generator: Zanata 4.3.3\n"
21
21
  "Language-Team: Chinese (Taiwan)\n"
22
22
 
23
- msgid ""
24
- "\n"
25
- "user quit"
26
- msgstr ""
27
- "\n"
28
- "使用者退出"
29
-
30
- #, python-format
31
- msgid "%(success)s successes, %(failure)s failures"
32
- msgstr "%(success)s 個成功,%(failure)s 個失敗"
33
-
34
- #, python-format
35
- msgid "%s already started..."
36
- msgstr "%s 已啟動..."
37
-
38
- #, python-format
39
- msgid "%s does not exist"
40
- msgstr "%s 不存在"
41
-
42
- #, python-format
43
- msgid "%s: Connection reset by peer"
44
- msgstr "%s:已由對等項目重設連線"
45
-
46
- #, python-format
47
- msgid ""
48
- "Attempted to replicate %(count)d dbs in %(time).5f seconds (%(rate).5f/s)"
49
- msgstr "已嘗試在 %(time).5f 秒內抄寫 %(count)d 個資料庫 (%(rate).5f/s)"
50
-
51
- msgid "Beginning replication run"
52
- msgstr "正在開始抄寫執行"
53
-
54
- msgid "Broker error trying to rollback locked connection"
55
- msgstr "嘗試回復已鎖定的連線時發生分配管理系統錯誤"
56
-
57
23
  #, python-format
58
24
  msgid "Can not access the file %s."
59
25
  msgstr "無法存取檔案 %s。"
@@ -62,45 +28,10 @@ msgstr "無法存取檔案 %s。"
62
28
  msgid "Can not load profile data from %s."
63
29
  msgstr "無法從 %s 中載入設定檔資料。"
64
30
 
65
- msgid "Connection refused"
66
- msgstr "連線遭拒"
67
-
68
- msgid "Connection timeout"
69
- msgstr "連線逾時"
70
-
71
31
  #, python-format
72
32
  msgid "Data download error: %s"
73
33
  msgstr "資料下載錯誤:%s"
74
34
 
75
- msgid "ERROR Failed to get my own IPs?"
76
- msgstr "錯誤:無法取得我自己的 IP?"
77
-
78
- #, python-format
79
- msgid "ERROR Remote drive not mounted %s"
80
- msgstr "錯誤:未裝載遠端磁碟機 %s"
81
-
82
- msgid "ERROR auditing"
83
- msgstr "審核時發生錯誤"
84
-
85
- #, python-format
86
- msgid "ERROR reading HTTP response from %s"
87
- msgstr "從 %s 讀取 HTTP 回應時發生錯誤"
88
-
89
- #, python-format
90
- msgid "ERROR reading db %s"
91
- msgstr "讀取資料庫 %s 時發生錯誤"
92
-
93
- #, python-format
94
- msgid "ERROR rsync failed with %(code)s: %(args)s"
95
- msgstr "錯誤:遠端同步失敗,%(code)s:%(args)s"
96
-
97
- #, python-format
98
- msgid "ERROR syncing %(file)s with node %(node)s"
99
- msgstr "同步 %(file)s 與節點 %(node)s 時發生錯誤"
100
-
101
- msgid "ERROR trying to replicate"
102
- msgstr "嘗試抄寫時發生錯誤"
103
-
104
35
  msgid "Error listing devices"
105
36
  msgstr "列出裝置時發生錯誤"
106
37
 
@@ -126,152 +57,29 @@ msgstr "擷取 recon 資料時發生錯誤"
126
57
  msgid "Error: An error occurred"
127
58
  msgstr "錯誤:發生錯誤"
128
59
 
129
- msgid "Error: missing config path argument"
130
- msgstr "錯誤:遺漏配置路徑引數"
131
-
132
- #, python-format
133
- msgid "Error: unable to locate %s"
134
- msgstr "錯誤:找不到 %s"
135
-
136
60
  #, python-format
137
61
  msgid "Following CNAME chain for %(given_domain)s to %(found_domain)s"
138
62
  msgstr "遵循 %(given_domain)s 到 %(found_domain)s 的 CNAME 鏈"
139
63
 
140
- msgid "Found configs:"
141
- msgstr "找到配置:"
142
-
143
- msgid "Host unreachable"
144
- msgstr "無法抵達主機"
145
-
146
- #, python-format
147
- msgid "Invalid X-Container-Sync-To format %r"
148
- msgstr "無效的 X-Container-Sync-To 格式 %r"
149
-
150
- #, python-format
151
- msgid "Invalid host %r in X-Container-Sync-To"
152
- msgstr "X-Container-Sync-To 中的主機 %r 無效"
153
-
154
- #, python-format
155
- msgid "Invalid pending entry %(file)s: %(entry)s"
156
- msgstr "無效的擱置項目 %(file)s:%(entry)s"
157
-
158
- #, python-format
159
- msgid ""
160
- "Invalid scheme %r in X-Container-Sync-To, must be \"//\", \"http\", or "
161
- "\"https\"."
162
- msgstr ""
163
- "X-Container-Sync-To 中的架構 %r 無效,必須是 \"//\"、\"http\" 或\"https\"。"
164
-
165
64
  #, python-format
166
65
  msgid "Mapped %(given_domain)s to %(found_domain)s"
167
66
  msgstr "已將 %(given_domain)s 對映至 %(found_domain)s"
168
67
 
169
- #, python-format
170
- msgid "No %s running"
171
- msgstr "沒有 %s 在執行中"
172
-
173
- #, python-format
174
- msgid "No permission to signal PID %d"
175
- msgstr "沒有信號 PID %d 的許可權"
176
-
177
- #, python-format
178
- msgid "No policy with index %s"
179
- msgstr "沒有具有索引 %s 的原則"
180
-
181
- #, python-format
182
- msgid "No realm key for %r"
183
- msgstr "沒有 %r 的範圍金鑰"
184
-
185
- msgid "Params, queries, and fragments not allowed in X-Container-Sync-To"
186
- msgstr "X-Container-Sync-To 中不容許參數、查詢及片段"
187
-
188
- msgid "Path required in X-Container-Sync-To"
189
- msgstr "X-Container-Sync-To 中需要路徑"
190
-
191
68
  #, python-format
192
69
  msgid "Profiling Error: %s"
193
70
  msgstr "側寫錯誤:%s"
194
71
 
195
- #, python-format
196
- msgid "Quarantining DB %s"
197
- msgstr "正在隔離資料庫 %s"
198
-
199
72
  #, python-format
200
73
  msgid "Ratelimit sleep log: %(sleep)s for %(account)s/%(container)s/%(object)s"
201
74
  msgstr "%(account)s/%(container)s/%(object)s 的 ratelimit 休眠日誌:%(sleep)s"
202
75
 
203
- #, python-format
204
- msgid "Removed %(remove)d dbs"
205
- msgstr "已移除 %(remove)d 個資料庫"
206
-
207
- #, python-format
208
- msgid "Removing pid file %(pid_file)s with wrong pid %(pid)d"
209
- msgstr "正在移除具有錯誤 PID %(pid)d 的 PID 檔 %(pid_file)s"
210
-
211
- #, python-format
212
- msgid "Removing pid file %s with invalid pid"
213
- msgstr "正在移除具有無效 PID 的 PID 檔 %s"
214
-
215
- #, python-format
216
- msgid "Removing stale pid file %s"
217
- msgstr "正在移除過時 PID 檔案 %s"
218
-
219
- msgid "Replication run OVER"
220
- msgstr "抄寫執行結束"
221
-
222
76
  #, python-format
223
77
  msgid "Returning 497 because of blacklisting: %s"
224
78
  msgstr "由於黑名單,正在傳回 497:%s"
225
79
 
226
- #, python-format
227
- msgid "Running %s once"
228
- msgstr "正在執行 %s 一次"
229
-
230
- #, python-format
231
- msgid "Skipping %s as it is not mounted"
232
- msgstr "正在跳過 %s,原因是它未裝載"
233
-
234
- #, python-format
235
- msgid "Starting %s"
236
- msgstr "正在啟動 %s"
237
-
238
80
  msgid "The file type are forbidden to access!"
239
81
  msgstr "此檔案類型禁止存取!"
240
82
 
241
- msgid "UNCAUGHT EXCEPTION"
242
- msgstr "未捕捉的異常狀況"
243
-
244
- #, python-format
245
- msgid "Unable to locate %s in libc. Leaving as a no-op."
246
- msgstr "在 libc 中找不到 %s。保留為 no-op。"
247
-
248
- #, python-format
249
- msgid "Unable to locate config for %s"
250
- msgstr "找不到 %s 的配置"
251
-
252
- msgid ""
253
- "Unable to locate fallocate, posix_fallocate in libc. Leaving as a no-op."
254
- msgstr "在 libc 中找不到 fallocate、posix_fallocate。保留為 no-op。"
255
-
256
- #, python-format
257
- msgid "Unable to read config from %s"
258
- msgstr "無法從 %s 讀取配置"
259
-
260
- msgid ""
261
- "WARNING: SSL should only be enabled for testing purposes. Use external SSL "
262
- "termination for a production deployment."
263
- msgstr ""
264
- "警告:應該僅啟用 SSL 以用於測試目的。使用外部SSL 終止以進行正式作業部署。"
265
-
266
- msgid "WARNING: Unable to modify file descriptor limit. Running as non-root?"
267
- msgstr "警告:無法修改檔案描述子限制。以非 root 使用者身分執行?"
268
-
269
- msgid "WARNING: Unable to modify max process limit. Running as non-root?"
270
- msgstr "警告:無法修改處理程序數上限限制。以非 root 使用者身分執行?"
271
-
272
- msgid "WARNING: Unable to modify memory limit. Running as non-root?"
273
- msgstr "警告:無法修改記憶體限制。以非 root 使用者身分執行?"
274
-
275
83
  msgid "Warning: Cannot ratelimit without a memcached client"
276
84
  msgstr "警告:無法在沒有 memcached 用戶端的情況下限制速率"
277
85
 
swift/obj/diskfile.py CHANGED
@@ -167,24 +167,36 @@ def _encode_metadata(metadata):
167
167
  return dict(((encode_str(k), encode_str(v)) for k, v in metadata.items()))
168
168
 
169
169
 
170
- def _decode_metadata(metadata):
170
+ def _decode_metadata(metadata, metadata_written_by_py3):
171
171
  """
172
172
  Given a metadata dict from disk, convert keys and values to native strings.
173
173
 
174
174
  :param metadata: a dict
175
+ :param metadata_written_by_py3:
175
176
  """
176
177
  if six.PY2:
177
- def to_str(item):
178
+ def to_str(item, is_name=False):
179
+ # For years, py2 and py3 handled non-ascii metadata differently;
180
+ # see https://bugs.launchpad.net/swift/+bug/2012531
181
+ if metadata_written_by_py3 and not is_name:
182
+ # do our best to read new-style data replicated from a py3 node
183
+ item = item.decode('utf8').encode('latin1')
178
184
  if isinstance(item, six.text_type):
179
185
  return item.encode('utf8')
180
186
  return item
181
187
  else:
182
- def to_str(item):
188
+ def to_str(item, is_name=False):
189
+ # For years, py2 and py3 handled non-ascii metadata differently;
190
+ # see https://bugs.launchpad.net/swift/+bug/2012531
191
+ if not metadata_written_by_py3 and isinstance(item, bytes) \
192
+ and not is_name:
193
+ # do our best to read old py2 data
194
+ item = item.decode('latin1')
183
195
  if isinstance(item, six.binary_type):
184
196
  return item.decode('utf8', 'surrogateescape')
185
197
  return item
186
198
 
187
- return dict(((to_str(k), to_str(v)) for k, v in metadata.items()))
199
+ return {to_str(k): to_str(v, k == b'name') for k, v in metadata.items()}
188
200
 
189
201
 
190
202
  def read_metadata(fd, add_missing_checksum=False):
@@ -238,6 +250,7 @@ def read_metadata(fd, add_missing_checksum=False):
238
250
  "stored checksum='%s', computed='%s'" % (
239
251
  fd, metadata_checksum, computed_checksum))
240
252
 
253
+ metadata_written_by_py3 = (b'_codecs\nencode' in metadata[:32])
241
254
  # strings are utf-8 encoded when written, but have not always been
242
255
  # (see https://bugs.launchpad.net/swift/+bug/1678018) so encode them again
243
256
  # when read
@@ -245,7 +258,7 @@ def read_metadata(fd, add_missing_checksum=False):
245
258
  metadata = pickle.loads(metadata)
246
259
  else:
247
260
  metadata = pickle.loads(metadata, encoding='bytes')
248
- return _decode_metadata(metadata)
261
+ return _decode_metadata(metadata, metadata_written_by_py3)
249
262
 
250
263
 
251
264
  def write_metadata(fd, metadata, xattr_size=65536):
@@ -2357,7 +2370,7 @@ class BaseDiskFileReader(object):
2357
2370
  self._logger.error(
2358
2371
  'ERROR DiskFile %(data_file)s'
2359
2372
  ' close failure: %(exc)s : %(stack)s',
2360
- {'exc': e, 'stack': ''.join(traceback.format_stack()),
2373
+ {'exc': e, 'stack': ''.join(traceback.format_exc()),
2361
2374
  'data_file': self._data_file})
2362
2375
  finally:
2363
2376
  fp, self._fp = self._fp, None
swift/obj/server.py CHANGED
@@ -56,7 +56,7 @@ from swift.common.swob import HTTPAccepted, HTTPBadRequest, HTTPCreated, \
56
56
  HTTPPreconditionFailed, HTTPRequestTimeout, HTTPUnprocessableEntity, \
57
57
  HTTPClientDisconnect, HTTPMethodNotAllowed, Request, Response, \
58
58
  HTTPInsufficientStorage, HTTPForbidden, HTTPException, HTTPConflict, \
59
- HTTPServerError, wsgi_to_bytes, wsgi_to_str, normalize_etag
59
+ HTTPServerError, bytes_to_wsgi, wsgi_to_bytes, wsgi_to_str, normalize_etag
60
60
  from swift.obj.diskfile import RESERVED_DATAFILE_META, DiskFileRouter
61
61
  from swift.obj.expirer import build_task_obj
62
62
 
@@ -150,6 +150,8 @@ class ObjectController(BaseStorageServer):
150
150
  self.slow = int(conf.get('slow', 0))
151
151
  self.keep_cache_private = \
152
152
  config_true_value(conf.get('keep_cache_private', 'false'))
153
+ self.keep_cache_slo_manifest = \
154
+ config_true_value(conf.get('keep_cache_slo_manifest', 'false'))
153
155
 
154
156
  default_allowed_headers = '''
155
157
  content-disposition,
@@ -678,7 +680,8 @@ class ObjectController(BaseStorageServer):
678
680
  list(self.allowed_headers))
679
681
  for header_key in headers_to_copy:
680
682
  if header_key in request.headers:
681
- header_caps = header_key.title()
683
+ header_caps = bytes_to_wsgi(
684
+ wsgi_to_bytes(header_key).title())
682
685
  metadata[header_caps] = request.headers[header_key]
683
686
  orig_delete_at = int(orig_metadata.get('X-Delete-At') or 0)
684
687
  if orig_delete_at != new_delete_at:
@@ -927,7 +930,8 @@ class ObjectController(BaseStorageServer):
927
930
  list(self.allowed_headers))
928
931
  for header_key in headers_to_copy:
929
932
  if header_key in request.headers:
930
- header_caps = header_key.title()
933
+ header_caps = bytes_to_wsgi(
934
+ wsgi_to_bytes(header_key).title())
931
935
  metadata[header_caps] = request.headers[header_key]
932
936
  return metadata
933
937
 
@@ -1096,9 +1100,19 @@ class ObjectController(BaseStorageServer):
1096
1100
  request.headers.pop('Range', None)
1097
1101
  obj_size = int(metadata['Content-Length'])
1098
1102
  file_x_ts = Timestamp(metadata['X-Timestamp'])
1099
- keep_cache = (self.keep_cache_private or
1100
- ('X-Auth-Token' not in request.headers and
1101
- 'X-Storage-Token' not in request.headers))
1103
+ keep_cache = (
1104
+ self.keep_cache_private
1105
+ or (
1106
+ "X-Auth-Token" not in request.headers
1107
+ and "X-Storage-Token" not in request.headers
1108
+ )
1109
+ or (
1110
+ self.keep_cache_slo_manifest
1111
+ and config_true_value(
1112
+ metadata.get("X-Static-Large-Object")
1113
+ )
1114
+ )
1115
+ )
1102
1116
  conditional_etag = resolve_etag_is_at_header(request, metadata)
1103
1117
  response = Response(
1104
1118
  app_iter=disk_file.reader(keep_cache=keep_cache),
@@ -45,8 +45,8 @@ def decode_missing(line):
45
45
  parts = line.decode('ascii').split()
46
46
  result['object_hash'] = urllib.parse.unquote(parts[0])
47
47
  t_data = urllib.parse.unquote(parts[1])
48
- result['ts_data'] = Timestamp(t_data)
49
- result['ts_meta'] = result['ts_ctype'] = result['ts_data']
48
+ result['ts_data'] = ts_data = Timestamp(t_data)
49
+ result['ts_meta'] = result['ts_ctype'] = ts_data
50
50
  result['durable'] = True # default to True in case this key isn't sent
51
51
  if len(parts) > 2:
52
52
  # allow for a comma separated list of k:v pairs to future-proof
@@ -54,9 +54,17 @@ def decode_missing(line):
54
54
  for item in [subpart for subpart in subparts if ':' in subpart]:
55
55
  k, v = item.split(':')
56
56
  if k == 'm':
57
- result['ts_meta'] = Timestamp(t_data, delta=int(v, 16))
57
+ v, _, o = v.partition('__')
58
+ # ignore ts_data offset when calculating ts_meta
59
+ result['ts_meta'] = Timestamp(ts_data.normal,
60
+ delta=int(v, 16),
61
+ offset=int(o or '0', 16))
58
62
  elif k == 't':
59
- result['ts_ctype'] = Timestamp(t_data, delta=int(v, 16))
63
+ v, _, o = v.partition('__')
64
+ # ignore ts_data offset when calculating ts_ctype
65
+ result['ts_ctype'] = Timestamp(Timestamp(ts_data).normal,
66
+ delta=int(v, 16),
67
+ offset=int(o or '0', 16))
60
68
  elif k == 'durable':
61
69
  result['durable'] = utils.config_true_value(v)
62
70
  return result
@@ -380,7 +388,8 @@ class Receiver(object):
380
388
  raise SsyncClientDisconnected
381
389
  if line.strip() != b':MISSING_CHECK: START':
382
390
  raise Exception(
383
- 'Looking for :MISSING_CHECK: START got %r' % line[:1024])
391
+ 'Looking for :MISSING_CHECK: START got %r'
392
+ % utils.cap_length(line, 1024))
384
393
  object_hashes = []
385
394
  nlines = 0
386
395
  while True:
@@ -442,7 +451,8 @@ class Receiver(object):
442
451
  # Guess they hung up waiting for us to process the missing check
443
452
  raise SsyncClientDisconnected
444
453
  if line.strip() != b':UPDATES: START':
445
- raise Exception('Looking for :UPDATES: START got %r' % line[:1024])
454
+ raise Exception('Looking for :UPDATES: START got %r'
455
+ % utils.cap_length(line, 1024))
446
456
  successes = 0
447
457
  failures = 0
448
458
  updates = 0
@@ -466,9 +476,9 @@ class Receiver(object):
466
476
  line = line.strip()
467
477
  if not line:
468
478
  break
469
- header, value = swob.bytes_to_wsgi(line).split(':', 1)
470
- header = header.strip().lower()
471
- value = value.strip()
479
+ header, value = line.split(b':', 1)
480
+ header = swob.bytes_to_wsgi(header.strip().lower())
481
+ value = swob.bytes_to_wsgi(value.strip())
472
482
  subreq.headers[header] = value
473
483
  if header not in ('etag', 'x-backend-no-commit'):
474
484
  # we'll use X-Backend-Replication-Headers to force the