Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

designate version number to avoid build error #211

Closed
wants to merge 10 commits into from
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@
[submodule "src/sonic-ztp"]
path = src/sonic-ztp
url = https://github.com/Azure/sonic-ztp
[submodule "platform/broadcom/sonic-platform-modules-cel"]
path = platform/broadcom/sonic-platform-modules-cel
url = https://github.com/celestica-Inc/sonic-platform-modules-cel.git
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ Ethernet29 113,114,115,116 QSFP29 29
Ethernet30 117,118,119,120 QSFP30 30
Ethernet31 121,122,123,124 QSFP31 31
Ethernet32 125,126,127,128 QSFP32 32
Ethernet33 129,130,131,132 QSFP33 33
Ethernet34 133,134,135,136 QSFP34 34
Ethernet35 137,138,139,140 QSFP35 35
Ethernet36 141,142,143,144 QSFP36 36
Ethernet37 145,146,147,148 QSFP37 37
Ethernet38 149,150,151,152 QSFP38 38
Ethernet39 153,154,155,156 QSFP39 39
Ethernet40 157,158,159,160 QSFP40 40
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())
Loading