Skip to content

Commit

Permalink
upgrade jaws openBMC plugins under device folder
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwill Ma <mamax@celestica.com>
  • Loading branch information
maxwill-ma authored and celestica-gl committed Oct 14, 2020
1 parent 0d2af36 commit bb25dbd
Show file tree
Hide file tree
Showing 7 changed files with 831 additions and 1,198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,33 @@
__author__ = 'Wirut G.<wgetbumr@celestica.com>'
__license__ = "GPL"
__version__ = "0.1.0"
__status__ = "Development"

__status__ = "Development"

import subprocess
import requests


class CpuTempUtil():
"""Platform-specific CpuTempUtil class"""

def __init__(self):
pass


def get_cpu_temp(self):

# Get list of temperature of CPU cores.
p = subprocess.Popen(['sensors', '-Au', 'coretemp-isa-0000'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(['sensors', '-Au', 'coretemp-isa-0000'], stdout=subprocess.PIPE,stderr=subprocess.PIPE)
out, err = p.communicate()
raw_data_list = out.splitlines()
temp_string_list = [i for i, s in enumerate(
raw_data_list) if '_input' in s]
temp_string_list = [i for i, s in enumerate(raw_data_list) if '_input' in s]
tmp_list = [0]

for temp_string in temp_string_list:
tmp_list.append(float(raw_data_list[temp_string].split(":")[1]))

return tmp_list


def get_max_cpu_tmp(self):
# Get maximum temperature from list of temperature of CPU cores.
return max(self.get_cpu_temp())
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

#############################################################################
# Celestica PHALANX
# Celestica DX010
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
Expand Down
Loading

0 comments on commit bb25dbd

Please sign in to comment.