mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Ensure rdurations are all floats for the highstate outputter
This commit is contained in:
parent
716c2bb7c8
commit
11e34d047b
1 changed files with 12 additions and 1 deletions
|
@ -133,7 +133,18 @@ def _format_host(host, data):
|
|||
# Increment result counts
|
||||
rcounts.setdefault(ret['result'], 0)
|
||||
rcounts[ret['result']] += 1
|
||||
rdurations.append(ret.get('duration', 0))
|
||||
rduration = ret.get('duration', 0)
|
||||
try:
|
||||
float(rduration)
|
||||
rdurations.append(rduration)
|
||||
except ValueError:
|
||||
rduration, _, _ = rduration.partition(' ms')
|
||||
try:
|
||||
float(rduration)
|
||||
rdurations.append(rduration)
|
||||
except ValueError:
|
||||
log.error('Cannot parse a float from duration {0}'
|
||||
.format(ret.get('duration', 0)))
|
||||
|
||||
tcolor = colors['GREEN']
|
||||
schanged, ctext = _format_changes(ret['changes'])
|
||||
|
|
Loading…
Add table
Reference in a new issue