swift-drive-audit: Work with ISO timestamps

Recent OSes are using ISO format for their kernel logs.
Closes-Bug: #2072609
Change-Id: I92fce513d06d8b0875dabf9e9a1b2c5a3a79d9b5
This commit is contained in:
Tim Burke
2024年07月17日 11:07:39 -07:00
parent 7c12870068
commit 78b986cb39

View File

@@ -147,7 +147,12 @@ def get_errors(error_re, log_file_pattern, minutes, logger,
log_time = datetime.datetime.strptime(
log_time_string, '%Y %b %d %H:%M:%S')
except ValueError:
continue
# Some versions use ISO timestamps instead
try:
log_time = datetime.datetime.strptime(
line[0:19], '%Y-%m-%dT%H:%M:%S')
except ValueError:
continue
if log_time > end_time:
for err in error_re:
for device in err.findall(line):
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.