Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[device/alibaba] - Update Airflow detection format #71

Merged
merged 1 commit into from Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = 'Wirut G.<[email protected]>'
__license__ = "GPL"
__version__ = "0.1.3"
__version__ = "0.1.4"
__status__ = "Development"

import requests
Expand Down Expand Up @@ -37,13 +37,19 @@ def request_data(self):
return self.fru_status_list, self.psu_info_list

def airflow_selector(self, pn):
# Set input type.
return {
"DPS-1100FB": "FTOB",
"DPS-1100AB": "BTOF",
"FSJ026-A20G": "FTOB",
"FSJ038-A20G": "BTOF"
}.get(pn, "Unknown")
# Set airflow type
pn = pn.upper()
if "DPS-1100FB" in pn:
airflow = "FTOB"
elif "DPS-1100AB" in pn:
airflow = "BTOF"
elif "FSJ026-A20G" in pn:
airflow = "FTOB"
elif "FSJ038-A20G" in pn:
airflow = "BTOF"
else:
airflow = "Unknown"
return airflow

def get_num_psus(self):
"""
Expand Down Expand Up @@ -236,7 +242,7 @@ def get_all(self):
psu_status_dict["InputStatus"] = True if psu_pw_status and psu_ps_status else False
psu_status_dict["OutputStatus"] = ac_status
psu_status_dict["AirFlow"] = self.airflow_selector(
psu_status_dict["PN"].split()[0])
psu_status_dict["PN"])
all_psu_dict[find_psu[0]] = psu_status_dict

return all_psu_dict
24 changes: 15 additions & 9 deletions device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = 'Wirut G.<[email protected]>'
__license__ = "GPL"
__version__ = "0.1.3"
__version__ = "0.1.4"
__status__ = "Development"

import requests
Expand Down Expand Up @@ -37,13 +37,19 @@ def request_data(self):
return self.fru_status_list, self.psu_info_list

def airflow_selector(self, pn):
# Set input type.
return {
"DPS-1100FB": "FTOB",
"DPS-1100AB": "BTOF",
"FSJ026-A20G": "FTOB",
"FSJ038-A20G": "BTOF"
}.get(pn, "Unknown")
# Set airflow type
pn = pn.upper()
if "DPS-1100FB" in pn:
airflow = "FTOB"
elif "DPS-1100AB" in pn:
airflow = "BTOF"
elif "FSJ026-A20G" in pn:
airflow = "FTOB"
elif "FSJ038-A20G" in pn:
airflow = "BTOF"
else:
airflow = "Unknown"
return airflow

def get_num_psus(self):
"""
Expand Down Expand Up @@ -236,7 +242,7 @@ def get_all(self):
psu_status_dict["InputStatus"] = True if psu_pw_status and psu_ps_status else False
psu_status_dict["OutputStatus"] = ac_status
psu_status_dict["AirFlow"] = self.airflow_selector(
psu_status_dict["PN"].split()[0])
psu_status_dict["PN"])
all_psu_dict[find_psu[0]] = psu_status_dict

return all_psu_dict
24 changes: 15 additions & 9 deletions device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = 'Wirut G.<[email protected]>'
__license__ = "GPL"
__version__ = "0.1.3"
__version__ = "0.1.4"
__status__ = "Development"

import requests
Expand Down Expand Up @@ -37,13 +37,19 @@ def request_data(self):
return self.fru_status_list, self.psu_info_list

def airflow_selector(self, pn):
# Set input type.
return {
"DPS-1100FB": "FTOB",
"DPS-1100AB": "BTOF",
"FSJ026-A20G": "FTOB",
"FSJ038-A20G": "BTOF"
}.get(pn, "Unknown")
# Set airflow type
pn = pn.upper()
if "DPS-1100FB" in pn:
airflow = "FTOB"
elif "DPS-1100AB" in pn:
airflow = "BTOF"
elif "FSJ026-A20G" in pn:
airflow = "FTOB"
elif "FSJ038-A20G" in pn:
airflow = "BTOF"
else:
airflow = "Unknown"
return airflow

def get_num_psus(self):
"""
Expand Down Expand Up @@ -236,7 +242,7 @@ def get_all(self):
psu_status_dict["InputStatus"] = True if psu_pw_status and psu_ps_status else False
psu_status_dict["OutputStatus"] = ac_status
psu_status_dict["AirFlow"] = self.airflow_selector(
psu_status_dict["PN"].split()[0])
psu_status_dict["PN"])
all_psu_dict[find_psu[0]] = psu_status_dict

return all_psu_dict