Skip to content

Commit

Permalink
Fixing LGTM alerts for PDDF2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FuzailBrcm committed Aug 6, 2020
1 parent 4c9dacb commit 48a322a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
11 changes: 3 additions & 8 deletions pddf_fanutil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ def _wrapper_get_fan_speed(idx):

def _wrapper_get_fan_speed_rear(idx):
if platform_chassis is not None:
try:
#TODO: find out a way to calculate rear fan speed using 2.0 APIs
#return platform_chassis.get_fan(idx-1).get_speed()
return 0
except NotImplementedError:
pass
# This wrapper API is invalid for Pl API 2.0 as every fan
# is treated as a separate fan
return 0
return platform_fanutil.get_speed_rear(idx)

def _wrapper_set_fan_speed(idx, percent):
Expand Down Expand Up @@ -200,7 +197,6 @@ def direction(index):
status_table = []

for fan in fan_ids:
msg = ""
fan_name = _wrapper_get_fan_name(fan)
if fan not in supported_fan:
click.echo("Error! The {} is not available on the platform.\n" \
Expand Down Expand Up @@ -232,7 +228,6 @@ def getspeed(index):
status_table = []

for fan in fan_ids:
msg = ""
fan_name = _wrapper_get_fan_name(fan)
if fan not in supported_fan:
click.echo("Error! The {} is not available on the platform.\n" \
Expand Down
3 changes: 0 additions & 3 deletions pddf_psuutil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,12 @@ def mfrinfo(index):
"""Display PSU manufacturer info"""
supported_psu = range(1, _wrapper_get_num_psus() + 1)
psu_ids = []
info = ""
if (index < 0):
psu_ids = supported_psu
else:
psu_ids = [index]

for psu in psu_ids:
msg = ""
psu_name = _wrapper_get_psu_name(psu)
if psu not in supported_psu:
click.echo("Error! The {} is not available on the platform.\n" \
Expand Down Expand Up @@ -262,7 +260,6 @@ def seninfo(index):
psu_ids = [index]

for psu in psu_ids:
msg = ""
psu_name = _wrapper_get_psu_name(psu)
if psu not in supported_psu:
click.echo("Error! The {} is not available on the platform.\n" \
Expand Down
1 change: 0 additions & 1 deletion pddf_thermalutil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def gettemp(index):
status_table = []

for thermal in thermal_ids:
msg = ""
thermal_name = _wrapper_get_thermal_name(thermal)
if thermal not in supported_thermal:
click.echo("Error! The {} is not available on the platform.\n" \
Expand Down

0 comments on commit 48a322a

Please sign in to comment.