Skip to content

Commit

Permalink
[BFN] fix get_name
Browse files Browse the repository at this point in the history
  • Loading branch information
KostiantynYarovyiBf committed Dec 10, 2021
1 parent 2e6bae1 commit 71797c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
except ImportError as e:
raise ImportError (str(e) + "- required module not found")

FAN_NEWPORT_NAME_LIST = ["FAN-1F", "FAN-1R", "FAN-2F", "FAN-2R", "FAN-3F", "FAN-3R",
"FAN-4F", "FAN-4R", "FAN-5F", "FAN-5R", "FAN-6F", "FAN-6R"]

def _fan_info_get(fan_num, cb, default=None):
def get_data(client):
return client.pltfm_mgr.pltfm_mgr_fan_info_get(fan_num)
Expand Down Expand Up @@ -40,8 +37,8 @@ def set_speed(self, percent):
def get_name(self):
print("self.fan_index ", self.fan_index)
if self.fan_index%2 == 0:
return "FAN-{}-R".format(self.fantrayindex)
return "FAN-{}-F".format(self.fantrayindex)
return "FAN-{}R".format(self.fantrayindex)
return "FAN-{}F".format(self.fantrayindex)

def get_presence(self):
return _fan_info_get(self.fan_index, lambda _: True, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
_CONST_MAX_FAN = 2
_MAX_FANTRAY = 5

_product_dict = {
"x86_64-accton_wedge100bf_32x-r0" : "Montara",
"x86_64-accton_as9516_32d-r0" : "Newport",
"Lx86_64-accton_as9516bf_32d-r0" : "Newport",
"x86_64-accton_wedge100bf_65x-r0" : "Mavericks"
}

def _fan_info_get_all():
for fan_num in range(1, _CONST_MAX_FAN + 1):
def get_data(client, fan_num=fan_num):
Expand Down Expand Up @@ -102,12 +109,6 @@ def get_maximum_consumed_power(self):
return 36.0

def get_platform_name():
_product_dict = {
"x86_64-accton_wedge100bf_32x-r0" : "Montara",
"x86_64-accton_as9516_32d-r0" : "Newport",
"Lx86_64-accton_as9516bf_32d-r0" : "Newport",
"x86_64-accton_wedge100bf_65x-r0" : "Mavericks"
}
return _product_dict.get(device_info.get_platform())

def fan_drawer_list_get():
Expand Down

0 comments on commit 71797c4

Please sign in to comment.