[Git][NTPsec/ntpsec][master] 2 commits: Fail silently if no TEMPer data to log.

Gary E. Miller gitlab at mg.gitlab.com
Wed Sep 28 02:13:51 UTC 2016


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


Commits:
66791689 by Gary E. Miller at 2016-09-27T19:10:35-07:00
Fail silently if no TEMPer data to log.

- - - - -
eacf97cd by Gary E. Miller at 2016-09-27T19:13:00-07:00
Only complain about no gpsd log at -D 1 and above.

- - - - -


2 changed files:

- contrib/temper-temp-log
- ntpstats/ntpviz


Changes:

=====================================
contrib/temper-temp-log
=====================================
--- a/contrib/temper-temp-log
+++ b/contrib/temper-temp-log
@@ -35,5 +35,9 @@ output = subprocess.check_output(["temper-poll", "-c"], universal_newlines=True)
 
 now = int(time.time())
 
-temp = float( output )
-print( str(now) + ' TEMPER ' + str(temp))
+try:
+    temp = float( output )
+    print( str(now) + ' TEMPER ' + str(temp))
+except:
+    # bad data, ignore it
+    raise SystemExit(1)


=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -199,7 +199,8 @@ plot \\
         gpslist.sort()
 
         if not len( gpsmap) or not len( gpslist):
-            sys.stderr.write("ntpviz: WARNING: no gps data to graph\n")
+            if 1 <= debug_level:
+                sys.stderr.write("ntpviz: INFO: no gps data to graph\n")
             return ''
 
         gps_data = ()



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/302985e932225a096e8980e28a28d3918e0250b6...eacf97cdc5b9c863c85cb039e6b91e607008e54e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160928/272b5289/attachment.html>


More information about the vc mailing list