Skip to content

Commit 90a82a7

Browse files
committed
[Dell EMC S5296F] Correct LGTM issues
Signed-off-by: Howard Persh <[email protected]>
1 parent d0af265 commit 90a82a7

4 files changed

Lines changed: 4 additions & 26 deletions

File tree

device/dell/x86_64-dellemc_s5296f_c3538-r0/plugins/psuutil.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#
55

66

7-
import os.path
87
import logging
98
import commands
109
import sys
@@ -41,9 +40,7 @@ def isDockerEnv(self):
4140
# Fetch a BMC register
4241
def get_pmc_register(self, reg_name):
4342

44-
status = 1
4543
global ipmi_sdr_list
46-
ipmi_dev_node = "/dev/pmi0"
4744
ipmi_cmd = IPMI_PSU_DATA
4845
dockerenv = self.isDockerEnv()
4946
if dockerenv == True:

device/dell/x86_64-dellemc_s5296f_c3538-r0/plugins/sfputil.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66

77
try:
88
import struct
9-
import sys
10-
import getopt
119
import time
1210
from sonic_sfp.sfputilbase import SfpUtilBase
1311
from os import *
1412
from mmap import *
1513
import io
1614
from sonic_sfp.sff8436 import sff8436InterfaceId
1715
from sonic_sfp.sff8436 import sff8436Dom
18-
from sonic_sfp.sff8472 import sff8472InterfaceId
1916
from sonic_sfp.sff8472 import sff8472Dom
2017

2118
except ImportError as e:
@@ -202,7 +199,7 @@ def set_low_power_mode(self, port_num, lpmode):
202199
reg_value = reg_value & ~mask
203200

204201
# Convert our register value back to a hex string and write back
205-
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
202+
self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
206203

207204
return True
208205

@@ -229,15 +226,15 @@ def reset(self, port_num):
229226
reg_value = reg_value & ~mask
230227

231228
# Convert our register value back to a hex string and write back
232-
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
229+
self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
233230

234231
# Sleep 1 second to allow it to settle
235232
time.sleep(1)
236233

237234
reg_value = reg_value | mask
238235

239236
# Convert our register value back to a hex string and write back
240-
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
237+
self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
241238

242239
return True
243240

platform/broadcom/sonic-platform-modules-dell/s5296f/scripts/platform_sensors.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
# * PSU
1212

1313

14-
import os
1514
import sys
1615
import logging
17-
import subprocess
1816
import commands
1917

2018
S5296F_MAX_FAN_TRAYS = 4
@@ -36,7 +34,6 @@
3634

3735
def ipmi_sensor_dump():
3836

39-
status = 1
4037
global ipmi_sdr_list
4138
ipmi_cmd = IPMI_SENSOR_DATA
4239
status, ipmi_sdr_list = commands.getstatusoutput(ipmi_cmd)
@@ -95,7 +92,6 @@ def print_temperature_sensors():
9592
def print_fan_tray(tray):
9693

9794
Fan_Status = [' Normal', ' Abnormal']
98-
Airflow_Direction = ['B2F', 'F2B']
9995

10096
print ' Fan Tray ' + str(tray) + ':'
10197

@@ -153,7 +149,6 @@ def get_psu_presence(index):
153149
:return: Boolean, True if PSU is plugged, False if not
154150
"""
155151
status = 0
156-
ret_status = 1
157152

158153
if index == 1:
159154
status, ipmi_cmd_ret = commands.getstatusoutput(IPMI_PSU1_DATA_DOCKER)
@@ -175,16 +170,6 @@ def get_psu_presence(index):
175170

176171
# Print the information for PSU1, PSU2
177172
def print_psu(psu):
178-
Psu_Type = ['Normal', 'Mismatch']
179-
Psu_Input_Type = ['AC', 'DC']
180-
PSU_STATUS_TYPE_BIT = 4
181-
PSU_STATUS_INPUT_TYPE_BIT = 1
182-
PSU_FAN_PRESENT_BIT = 2
183-
PSU_FAN_STATUS_BIT = 1
184-
PSU_FAN_AIR_FLOW_BIT = 0
185-
Psu_Fan_Presence = ['Present', 'Absent']
186-
Psu_Fan_Status = ['Normal', 'Abnormal']
187-
Psu_Fan_Airflow = ['B2F', 'F2B']
188173

189174
# print ' Input: ', Psu_Input_Type[psu_input_type]
190175
# print ' Type: ', Psu_Type[psu_type]

platform/broadcom/sonic-platform-modules-dell/s5296f/scripts/qsfp_irq_enable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
try:
44
import struct
5-
import sys
65
from os import *
76
from mmap import *
87

@@ -22,7 +21,7 @@ def pci_mem_write(mm, offset, data):
2221
def pci_set_value(resource, val, offset):
2322
fd = open(resource, O_RDWR)
2423
mm = mmap(fd, 0)
25-
val = pci_mem_write(mm, offset, val)
24+
pci_mem_write(mm, offset, val)
2625
mm.close()
2726
close(fd)
2827
return val

0 commit comments

Comments
 (0)