Skip to content

Commit 07ca935

Browse files
committed
At #5, Update the get_sensor_data function in the IPMI module
1 parent 1d946bf commit 07ca935

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

salt/modules/ipmi.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,10 +658,17 @@ def get_sensor_data(**kwargs):
658658

659659
with _IpmiCommand(**kwargs) as s:
660660
data = {}
661+
cpuIndex = 0
661662
for reading in s.get_sensor_data():
662663
if reading:
663664
r = ast.literal_eval(repr(reading))
664-
data[r.pop("name")] = r
665+
objKey = ""
666+
if r["name"] == "Temp" and r["type"] == "Temperature":
667+
cpuIndex += 1
668+
objKey = "CPU{} {}".format(cpuIndex, r.pop("name"))
669+
else:
670+
objKey = r.pop("name")
671+
data[objKey] = r
665672
return data
666673

667674

0 commit comments

Comments
 (0)