Skip to content

Commit 8cf79f2

Browse files
fix: 修复 list_dir 函数在分页查询参数错误的问题 (TencentBlueKing#235)
1 parent 2ee4bc0 commit 8cf79f2

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

sdks/bk-storages/CHANGE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Change logs
22

3+
### 2.0.1
4+
5+
- 修复 `BKRepoStorage` list_dir 函数在分页查询参数错误的问题
6+
37
### 2.0.0
48

59
- 支持 Python 3.11,移除对 Python 3.6, 3.7 的支持

sdks/bk-storages/bkstorages/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
99
* specific language governing permissions and limitations under the License.
1010
"""
11-
__version__ = "2.0.0"
11+
__version__ = "2.0.1"

sdks/bk-storages/bkstorages/backends/bkrepo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def __list_dir(self, key_prefix: str, cur_page: int = 1) -> Tuple[List, List, bo
236236
client = self.get_client()
237237
url = urljoin(self.endpoint_url, f"/repository/api/node/page/{self.project}/{self.bucket}/{key_prefix}")
238238
# NOTE: 按分页查询 bkrepo 的文件数, 1000 是一个经验值, 设置仅可能大的数值是避免发送太多次请求到 bk-repo
239-
params = {"pageSize": 1000, "PageNumber": cur_page, "includeFolder": True}
239+
params = {"pageSize": 1000, "pageNumber": cur_page, "includeFolder": True}
240240
resp = client.get(url, params=params, timeout=TIMEOUT_THRESHOLD)
241241
data = self._validate_resp(resp)
242242
total_pages = data["totalPages"]

sdks/bk-storages/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "bkstorages"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
description = "File storage backends for blueking PaaS platform"
55
readme = "README.md"
66
authors = ["blueking <blueking@tencent.com>"]

sdks/bk-storages/tests/test_bkrepo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def test_list_dir(self, bk_repo_storage, adapter, endpoint, mock_responses, expe
134134
urljoin(
135135
endpoint,
136136
f"/repository/api/node/page/dummy-project/dummy-bucket/"
137-
f"{path}?pageSize=1000&PageNumber={idx + 1}&includeFolder=True",
137+
f"{path}?pageSize=1000&pageNumber={idx + 1}&includeFolder=True",
138138
),
139139
json={"code": 0, "message": 0, "data": {"totalPages": len(mock_responses), "records": records}},
140140
)

0 commit comments

Comments
 (0)