[Git][NTPsec/ntpsec][master] cpu-temp-log: Fail more gracefully if 'sensors' is not found.
Gary E. Miller
gitlab at mg.gitlab.com
Tue Dec 13 03:32:02 UTC 2016
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
c74ccb19 by Gary E. Miller at 2016-12-12T19:31:19-08:00
cpu-temp-log: Fail more gracefully if 'sensors' is not found.
- - - - -
1 changed file:
- contrib/cpu-temp-log
Changes:
=====================================
contrib/cpu-temp-log
=====================================
--- a/contrib/cpu-temp-log
+++ b/contrib/cpu-temp-log
@@ -39,7 +39,11 @@ temperatures will be hardware specific.
import sys, re, time, subprocess
-output = subprocess.check_output(["sensors", "-u"], universal_newlines=True)
+try:
+ output = subprocess.check_output(["sensors", "-u"], universal_newlines=True)
+except:
+ print("Unable to run 'sensors -u'")
+ exit(0)
lines = output.split( '\n' )
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/c74ccb19ecb4e7eee9f024ea3fe743a84dd3b446
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161213/fc2bedd7/attachment.html>
More information about the vc
mailing list