Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qa/1480
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ END { print int(sum+0.5) }'`
echo "pminfo -f lmsensors output:" >> $seq_full

PMDA=`pminfo -f lmsensors | tee -a $seq_full | grep '^ *value ' | \
awk '{ sum += $2 } END { print sum }'`
awk '{ sum += $2 } END { print sum+0 }'`

if _within_tolerance "Expecting $SENS +- 10%" $PMDA $SENS 10%; then
echo -n "The output of the 'sensors -u' values differs not more than 10% "
Expand Down
8 changes: 7 additions & 1 deletion src/pmdas/lmsensors/pmdalmsensors.python
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ def lmsensors_get(chip=None):
if chip:
cmd.append(chip)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=devnull)
output = json.loads(re.sub("[0-9]_", "_", p.communicate()[0].decode("utf-8")))
raw = p.communicate()[0].decode("utf-8")
try:
output = json.loads(re.sub("[0-9]_", "_", raw))
except (json.JSONDecodeError, ValueError):
if chip:
return
raise

if args.debug_value and args.debug_value >= 0:
print("function lmsensors_get(), json object after removing redundant naming:\n", output)
Expand Down
Loading