You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.7 KiB
35 lines
1.7 KiB
commit ce6112399ebf0ff39069a34bc9286242c875555e
|
|
Author: adam kaminski <adam@adamkaminski.com>
|
|
Date: Fri Feb 9 12:49:34 2024 -0500
|
|
|
|
pmapi.py : fix for struct_time() and day of year out of range on yyyy-01-01
|
|
|
|
Fix for `day of year out of range` on 2024-01-01, due to self.tm_yday - 1, which returns `[2024, 1, 1, 2, 3, 0, 0, -1, 0]`. The range for tm_yday should be [1, 366].
|
|
|
|
# timedatectl set-ntp false
|
|
# timedatectl set-time "2024-01-01 00:00:00"
|
|
# /usr/libexec/pcp/bin/pcp-mpstat -P ALL -t 1 -s 2
|
|
Traceback (most recent call last):
|
|
File "/usr/libexec/pcp/bin/pcp-mpstat", line 653, in <module>
|
|
sts = manager.run()
|
|
File "/usr/lib64/python3.6/site-packages/pcp/pmcc.py", line 687, in run
|
|
self._printer.report(self)
|
|
File "/usr/libexec/pcp/bin/pcp-mpstat", line 606, in report
|
|
self.print_machine_info(group, manager)
|
|
File "/usr/libexec/pcp/bin/pcp-mpstat", line 585, in print_machine_info
|
|
time_string = time.strftime("%x", timestamp.struct_time())
|
|
ValueError: day of year out of range
|
|
|
|
diff -Naurp pcp-5.3.7.orig/src/python/pcp/pmapi.py pcp-5.3.7/src/python/pcp/pmapi.py
|
|
--- pcp-5.3.7.orig/src/python/pcp/pmapi.py 2022-04-05 09:05:43.000000000 +1000
|
|
+++ pcp-5.3.7/src/python/pcp/pmapi.py 2024-08-08 09:56:16.298625548 +1000
|
|
@@ -299,7 +299,7 @@ class tm(Structure):
|
|
pywday = 6
|
|
stlist = [self.tm_year + 1900, self.tm_mon + 1, self.tm_mday,
|
|
self.tm_hour, self.tm_min, self.tm_sec,
|
|
- pywday, self.tm_yday - 1, self.tm_isdst]
|
|
+ pywday, self.tm_yday + 1, self.tm_isdst]
|
|
return time.struct_time(stlist)
|
|
|
|
def __str__(self):
|