Skip to content

Commit

Permalink
fix issue found by lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox committed Apr 9, 2020
1 parent 4378910 commit 9a1c052
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
2 changes: 0 additions & 2 deletions platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from sonic_daemon_base.daemon_base import Logger
from os import listdir
from os.path import isfile, join
from glob import glob
import sys
import io
import re
Expand Down Expand Up @@ -97,7 +96,6 @@ def initialize_fan(self):
drawer_num = fan_data['drawer_num']
drawer_type = fan_data['drawer_type']
fan_num_per_drawer = fan_data['fan_num_per_drawer']
support_fan_direction = fan_data['support_fan_direction']
drawer_ctor = RealDrawer if drawer_type == 'real' else VirtualDrawer
fan_index = 0
for drawer_index in range(drawer_num):
Expand Down
30 changes: 2 additions & 28 deletions platform/mellanox/mlnx-platform-api/sonic_platform/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

try:
from sonic_platform_base.fan_base import FanBase
from .led import FanLed, VirtualLed, PsuLed
from .led import FanLed, VirtualLed
except ImportError as e:
raise ImportError (str(e) + "- required module not found")

Expand All @@ -27,7 +27,7 @@ class Fan(FanBase):
"""Platform-specific Fan class"""

def __init__(self, fan_index, fan_drawer, psu_fan = False):
super(FanBase, self).__init__()
super(Fan, self).__init__()
# API index is starting from 0, Mellanox platform index is starting from 1
self.index = fan_index + 1
self.fan_drawer = fan_drawer
Expand Down Expand Up @@ -252,29 +252,3 @@ def get_speed_tolerance(self):
"""
# The tolerance value is fixed as 20% for all the Mellanox platform
return 20


class PsuFan(FanBase):
def __init__(self):
super(FanBase, self).__init__()

def get_direction(self):
"""
Retrieves the fan's direction
Returns:
A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST
depending on fan direction
Notes:
What Mellanox calls forward:
Air flows from fans side to QSFP side, for example: MSN2700-CS2F
which means intake in community
What Mellanox calls reverse:
Air flow from QSFP side to fans side, for example: MSN2700-CS2R
which means exhaust in community
According to hw-mgmt:
1 stands for forward, in other words intake
0 stands for reverse, in other words exhaust
"""
return self.FAN_DIRECTION_NOT_APPLICABLE
4 changes: 0 additions & 4 deletions platform/mellanox/mlnx-platform-api/sonic_platform/led.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import os
try:
from sonic_platform_base.fan_base import FanBase
except ImportError as e:
raise ImportError (str(e) + "- required module not found")


class Led(object):
Expand Down

0 comments on commit 9a1c052

Please sign in to comment.