Skip to content

Commit c52cdd4

Browse files
committed
workflows: fstests: fix datetime parsing with timezone suffixes
The fstests watchdog was crashing with ValueError when timestamps included timezone suffixes like "-07:00". Strip these suffixes before parsing to avoid the error. Generated-by: Claude AI Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 4a96aec commit c52cdd4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/workflows/lib/fstests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ def get_fstest_host(use_remote, use_ssh, host, basedir, kernel, section, config)
117117
current_time_str = systemd_remote.get_current_time(host).rstrip()
118118

119119
fstests_date_str_format = "%Y-%m-%d %H:%M:%S"
120+
# Strip timezone suffix if present (e.g., "-07:00" or "+00:00")
121+
import re
122+
123+
last_test_time = re.sub(r"[+-]\d{2}:\d{2}$", "", last_test_time)
124+
current_time_str = re.sub(r"[+-]\d{2}:\d{2}$", "", current_time_str)
125+
120126
d1 = datetime.strptime(last_test_time, fstests_date_str_format)
121127
d2 = datetime.strptime(current_time_str, fstests_date_str_format)
122128

0 commit comments

Comments
 (0)