[Git][NTPsec/ntpsec][master] Skip non-dated log files

Gary E. Miller gitlab at mg.gitlab.com
Tue Dec 20 00:30:52 UTC 2016


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
8d696585 by Richard Laager at 2016-12-19T18:24:28-06:00
Skip non-dated log files

ntpd creates both dated (e.g. peerstats.YYMMDDD) and non-dated
(e.g. peerstats) log files.  ntpviz should only look at the dated
files to avoid loading duplicate data.

- - - - -


1 changed file:

- pylib/statfiles.py


Changes:

=====================================
pylib/statfiles.py
=====================================
--- a/pylib/statfiles.py
+++ b/pylib/statfiles.py
@@ -83,7 +83,10 @@ class NTPStats:
                  "temps", "gpsd"):
             lines = []
             try:
-                for logpart in glob.glob(os.path.join(statsdir, stem) + "*"):
+                pattern = os.path.join(statsdir, stem)
+                if stem != "temps" and stem != "gpsd":
+                    pattern += "."
+                for logpart in glob.glob(pattern + "*"):
                     # skip files older than starttime
                     if starttime > os.path.getmtime(logpart):
                         continue



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8d696585fb3dc092c472a390da006f74ea1af12e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161220/65040897/attachment.html>


More information about the vc mailing list