diff options
author | Karel Kočí <cynerd@email.cz> | 2015-07-28 22:20:10 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-07-28 22:20:10 +0200 |
commit | 26bdef9f50edcb0e4f22e39d2d8736644b6d6a5c (patch) | |
tree | ecc3cf95558bf656c56d0627bea87fbf1c9c952b /scripts | |
parent | 798da7f0a729c4c2d790b276e46b816bd53c8d47 (diff) | |
download | linux-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.py | 15 |
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 |