[Git][NTPsec/ntpsec][master] Address GitLab issue #525: iso8601() has unused argument 't'

Eric S. Raymond gitlab at mg.gitlab.com
Mon Dec 17 12:05:27 UTC 2018


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
fd0f1d86 by Eric S. Raymond at 2018-12-17T12:01:27Z
Address GitLab issue #525: iso8601() has unused argument 't'

Fixes a paste-o that always showed the ntpmon update time as the current time
rather than time of last span in control message.  It was hard to notice the
(usually small) difference, or this would have been fixed sooner.

- - - - -


1 changed file:

- ntpclients/ntpmon.py


Changes:

=====================================
ntpclients/ntpmon.py
=====================================
@@ -71,8 +71,8 @@ stdscr = None
 
 
 def iso8601(t):
-    "ISO8601 string from Unix time, including fractional second."
-    return time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(time.time()))
+    "ISO8601 string from Unix time."
+    return time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(t))
 
 
 def statline(_peerlist, _mrulist, nyquist):
@@ -82,7 +82,7 @@ def statline(_peerlist, _mrulist, nyquist):
     leader = re.sub(r" \([^\)]*\)", "", leader)
     if span.entries:
         trailer = "Updated: %s (%s)" \
-                  % (iso8601(span.entries[0].last).split("T")[1],
+                  % (iso8601(int(ntp.ntpc.lfptofloat(span.entries[0].last))),
                      ntp.util.PeerSummary.prettyinterval(nyquist))
     else:
         trailer = ""



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fd0f1d8603fb9a31b57663c13326e859a68e4b2c

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fd0f1d8603fb9a31b57663c13326e859a68e4b2c
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20181217/278c7fa1/attachment-0001.html>


More information about the vc mailing list