mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
get_sensor_data would always fail
get_sensor_data would always fail the solution is a little messy but it now works.
This commit is contained in:
parent
ebd6cdc412
commit
817e434591
1 changed files with 5 additions and 2 deletions
|
@ -604,10 +604,13 @@ def get_sensor_data(**kwargs):
|
|||
|
||||
salt-call ipmi.get_sensor_data api_host=127.0.0.1 api_user=admin api_pass=pass
|
||||
'''
|
||||
with _IpmiCommand(**kwargs) as s:
|
||||
import ast
|
||||
with IpmiCommand(**kwargs) as s:
|
||||
data = {}
|
||||
for reading in s.get_sensor_data():
|
||||
data[reading['name']] = reading
|
||||
if reading:
|
||||
r = ast.literal_eval(repr(reading))
|
||||
data[r.pop('name')] = r
|
||||
return data
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue