Skip to content

Commit b535ba9

Browse files
committed
api: fix error_report_delete
The delete parameters are encoded in the body, so they do not need to be wrapped in a list. Fixes: 85cef60 ("linstorapi: Correctly encode all rest url path calls")
1 parent f0dc602 commit b535ba9

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
### Fixed
12+
13+
- Correctly pass parameters in error_report_delete
14+
1115
## [1.25.2] - 2025-04-08
1216

1317
### Changed

linstor/linstorapi.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,8 +3696,8 @@ def error_report_delete(
36963696
Deletes error-reports on the linstor cluster, filtered by the given parameters
36973697
36983698
:param list[str] nodes: Only delete error-reports from these nodes, if None or empty all
3699-
:param datetime since: Start datetime from when to delete
3700-
:param datetime to: Until datetime to delete
3699+
:param datetime.datetime since: Start datetime from when to delete
3700+
:param datetime.datetime to: Until datetime to delete
37013701
:param str exception: Delete error reports matching this exception string
37023702
:param str version: Delete error reports matching this version string
37033703
:param list[str] ids: Error report ids to delete
@@ -3711,15 +3711,15 @@ def error_report_delete(
37113711
body["nodes"] = nodes
37123712

37133713
if since:
3714-
body["since"] = [str(int(time.mktime(since.timetuple()) * 1000))]
3714+
body["since"] = int(time.mktime(since.timetuple()) * 1000)
37153715
if to:
3716-
body["to"] = [str(int(time.mktime(to.timetuple()) * 1000))]
3716+
body["to"] = int(time.mktime(to.timetuple()) * 1000)
37173717

37183718
if exception:
3719-
body["exception"] = [exception]
3719+
body["exception"] = exception
37203720

37213721
if version:
3722-
body["version"] = [version]
3722+
body["version"] = version
37233723

37243724
if ids:
37253725
body["ids"] = ids

0 commit comments

Comments
 (0)