aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-07-28 22:20:10 +0200
committerKarel Kočí <cynerd@email.cz>2015-07-28 22:20:10 +0200
commit26bdef9f50edcb0e4f22e39d2d8736644b6d6a5c (patch)
treeecc3cf95558bf656c56d0627bea87fbf1c9c952b /scripts
parent798da7f0a729c4c2d790b276e46b816bd53c8d47 (diff)
downloadlinux-conf-perf-26bdef9f50edcb0e4f22e39d2d8736644b6d6a5c.tar.gz
linux-conf-perf-26bdef9f50edcb0e4f22e39d2d8736644b6d6a5c.tar.bz2
linux-conf-perf-26bdef9f50edcb0e4f22e39d2d8736644b6d6a5c.zip
Ignore any exception raised while parsing output of boot output
Any exception raised from user script, that should parse boot command output, should be ignored. If fails, no value is written to database.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/boot.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/boot.py b/scripts/boot.py
index dd40b35..7ae30a9 100644
--- a/scripts/boot.py
+++ b/scripts/boot.py
@@ -26,12 +26,17 @@ def boot(config, to_database = True):
f.write(line)
# Let user script parse double value
- out = utils.callsubprocess('parse_command', conf.parse_command,
- conf.parse_output, True)
- value = float(out[0])
+
+ value = None
+ try:
+ out = utils.callsubprocess('parse_command', conf.parse_command,
+ conf.parse_output, True)
+ value = float(out[0])
+ except Exception as e:
+ print("W: parse exception: " + e.__str__())
if to_database:
- dtb = database.database()
- dtb.add_measure(config.cfile, config.id, value)
+ dtb = database.database()
+ dtb.add_measure(config.cfile, config.id, value)
return config.cfile