Skip to content

Commit

Permalink
[Author]:jersyang@celestica.com [JIRA ID]:NA [Description]:1. change …
Browse files Browse the repository at this point in the history
…the baud rate to 9600 2. optimize the alert in Azure community
  • Loading branch information
nicwu-cel committed Feb 18, 2022
1 parent 7c3a57d commit a20602a
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion device/celestica/x86_64-cel_belgite-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200
CONSOLE_SPEED=9600
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich crashkernel=0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M acpi_no_watchdog"
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static ssize_t reason_show(struct device *dev,

bootstatus = watchdog_get_reason(wdt);

return sprintf(buf, "0x%02\n", bootstatus);
return sprintf(buf, "0x%02x\n", bootstatus);
}

static DEVICE_ATTR_RO(reason);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# All the derived classes for PDDF
__all__ = ["platform", "chassis", "sfp", "psu", "thermal"]
from sonic_platform import *
from sonic_platform import * #[py/polluting-import]

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None):
with open(FAN_DIRECTION_FILE_PATH, "w+") as f:
f.write(vendor_ext)
for i in range(self.platform_inventory['num_fantrays']):
fandrawer = FanDrawer(i, self.pddf_obj, self.plugin_data)
fandrawer = FanDrawer(i, self.pddf_obj, self.plugin_data) #lgtm [py/call/wrong-number-class-arguments]
self._fan_drawer_list.append(fandrawer)
self._fan_list.extend(fandrawer._fan_list)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None):
if self.eeprom_path is None:
return

super(PddfEeprom, self).__init__(self.eeprom_path, 0, '', True)
#super(PddfEeprom, self).__init__(self.eeprom_path, 0, '', True)
super().__init__(self.eeprom_path, 0, '', True)
self.eeprom_tlv_dict = dict()
try:
self.eeprom_data = self.read_eeprom()
Expand All @@ -49,7 +50,7 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None):
code = "0x%02X" % ((tlv[0]))

if (tlv[0]) == self._TLV_CODE_VENDOR_EXT:
name = "Vendor Extension"
name = "Vendor Extension" #lgtm [py/multiple-definition]
value = ""
if self._TLV_DISPLAY_VENDOR_EXT:
for c in tlv[2:2 + tlv[1]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None):
self.fantray_index = tray_idx+1
for j in range(self.platform['num_fans_pertray']):
# Fan index is 0-based for the init call
self._fan_list.append(Fan(tray_idx, j, self.pddf_obj, self.plugin_data))
self._fan_list.append(Fan(tray_idx, j, self.pddf_obj, self.plugin_data)) #lgtm [py/call/wrong-number-class-arguments]

def get_name(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
# Watchdog contains an implementation of SONiC Platform Base Watchdog API
#
#############################################################################
import ctypes
import fcntl
import os
import subprocess
import time
import array
import syslog

try:
from sonic_platform_base.watchdog_base import WatchdogBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys
from setuptools import setup
os.listdir

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import logging.config
import time # this is only being used as part of the example
import signal
import math
from sonic_platform import platform
except ImportError as e:
raise ImportError('%s - required module not found' % str(e))
Expand Down Expand Up @@ -121,21 +122,21 @@ def get_fan_speed_by_temperature(self, temp_list):

# U4 U7
if not update_temp_sensor: # temperature down
b = 1400/13
b = math.trunc(1400/13)
if sensor_temp <= 32000:
sensor_temp_speed = 40
elif sensor_temp >= 45000:
sensor_temp_speed = 100
else:
sensor_temp_speed = int((60 / 13) * int(sensor_temp / 1000) - b)
sensor_temp_speed = int(math.trunc(60 / 13) * math.trunc(sensor_temp / 1000) - b)
else: # temperature up
b = 1580 / 13
b = math.trunc(1580 / 13)
if sensor_temp <= 35000:
sensor_temp_speed = 40
elif sensor_temp >= 48000:
sensor_temp_speed = 100
else:
sensor_temp_speed = int((60/13) * int(sensor_temp/1000) - b)
sensor_temp_speed = int(math.trunc(60/13) * math.trunc(sensor_temp/1000) - b)

# CPU
if not update_temp_cpu: # temperature down
Expand Down

0 comments on commit a20602a

Please sign in to comment.