Skip to content

Commit

Permalink
Merge pull request #142 from mudsut4ke/Ali-upgrade-platformutil-0.2
Browse files Browse the repository at this point in the history
[device/alibaba]: fix cpld name and bmc reboot issue
  • Loading branch information
Wirut Getbamrung authored Mar 19, 2020
2 parents e2cf009 + 4497c5e commit 9fb4bcd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 42 deletions.
21 changes: 7 additions & 14 deletions device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/fwmgrutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

__author__ = 'Wirut G.<wgetbumr@celestica.com>'
__license__ = "GPL"
__version__ = "0.2.0"
__version__ = "0.2.1"
__status__ = "Development"

import subprocess
Expand Down Expand Up @@ -314,16 +314,9 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None):
self.__update_fw_upgrade_logger(
"bmc_upgrade", "switch to boot from %s" % flash)
self.set_bmc_boot_flash(flash)
self.__update_fw_upgrade_logger(
"bmc_upgrade", "reboot BMC")
if not self.reboot_bmc():
return False
else:
self.__update_fw_upgrade_logger(
"bmc_upgrade", "reboot BMC")
reboot_dict = {}
reboot_dict["reboot"] = "yes"
r = requests.post(self.bmc_info_url, json=reboot_dict)
self.__update_fw_upgrade_logger("bmc_upgrade", "reboot BMC")
if not self.reboot_bmc():
return False
last_fw_upgrade[3] = "DONE"
else:
self.__update_fw_upgrade_logger(
Expand Down Expand Up @@ -754,8 +747,8 @@ def firmware_refresh(self, fpga_list, cpld_list, fw_extra=None):
self.__update_fw_upgrade_logger(
"fw_refresh", "start firmware refresh")

cpld_list = [x.lower() for x in cpld_list] if cpld_list else []
fpga_list = [x.lower() for x in fpga_list] if fpga_list else []
cpld_list = [x.upper() for x in cpld_list] if cpld_list else []
fpga_list = [x.upper() for x in fpga_list] if fpga_list else []
refresh_list = cpld_list + fpga_list
fw_path_list = str(fw_extra).split(':')
refresh_img_list = ["none" for i in range(len(refresh_list))]
Expand All @@ -766,7 +759,7 @@ def firmware_refresh(self, fpga_list, cpld_list, fw_extra=None):
return False

for idx in range(0, len(refresh_list)):
if refresh_list[idx] in ["fan_cpld", "base_cpld"]:
if refresh_list[idx] in ["FAN_CPLD", "BASE_CPLD"]:
if not self.upload_file_bmc(fw_path_list[idx]):
self.__update_fw_upgrade_logger(
"cpld_refresh", "fail, message=Unable to upload refresh image to BMC")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

__author__ = 'Wirut G.<wgetbumr@celestica.com>'
__license__ = "GPL"
__version__ = "0.2.0"
__version__ = "0.2.1"
__status__ = "Development"

import subprocess
Expand Down Expand Up @@ -314,16 +314,9 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None):
self.__update_fw_upgrade_logger(
"bmc_upgrade", "switch to boot from %s" % flash)
self.set_bmc_boot_flash(flash)
self.__update_fw_upgrade_logger(
"bmc_upgrade", "reboot BMC")
if not self.reboot_bmc():
return False
else:
self.__update_fw_upgrade_logger(
"bmc_upgrade", "reboot BMC")
reboot_dict = {}
reboot_dict["reboot"] = "yes"
r = requests.post(self.bmc_info_url, json=reboot_dict)
self.__update_fw_upgrade_logger("bmc_upgrade", "reboot BMC")
if not self.reboot_bmc():
return False
last_fw_upgrade[3] = "DONE"
else:
self.__update_fw_upgrade_logger(
Expand Down Expand Up @@ -754,8 +747,8 @@ def firmware_refresh(self, fpga_list, cpld_list, fw_extra=None):
self.__update_fw_upgrade_logger(
"fw_refresh", "start firmware refresh")

cpld_list = [x.lower() for x in cpld_list] if cpld_list else []
fpga_list = [x.lower() for x in fpga_list] if fpga_list else []
cpld_list = [x.upper() for x in cpld_list] if cpld_list else []
fpga_list = [x.upper() for x in fpga_list] if fpga_list else []
refresh_list = cpld_list + fpga_list
fw_path_list = str(fw_extra).split(':')
refresh_img_list = ["none" for i in range(len(refresh_list))]
Expand All @@ -766,7 +759,7 @@ def firmware_refresh(self, fpga_list, cpld_list, fw_extra=None):
return False

for idx in range(0, len(refresh_list)):
if refresh_list[idx] in ["fan_cpld", "base_cpld"]:
if refresh_list[idx] in ["FAN_CPLD", "BASE_CPLD"]:
if not self.upload_file_bmc(fw_path_list[idx]):
self.__update_fw_upgrade_logger(
"cpld_refresh", "fail, message=Unable to upload refresh image to BMC")
Expand Down
21 changes: 7 additions & 14 deletions device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/fwmgrutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

__author__ = 'Wirut G.<wgetbumr@celestica.com>'
__license__ = "GPL"
__version__ = "0.2.0"
__version__ = "0.2.1"
__status__ = "Development"

import subprocess
Expand Down Expand Up @@ -314,16 +314,9 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None):
self.__update_fw_upgrade_logger(
"bmc_upgrade", "switch to boot from %s" % flash)
self.set_bmc_boot_flash(flash)
self.__update_fw_upgrade_logger(
"bmc_upgrade", "reboot BMC")
if not self.reboot_bmc():
return False
else:
self.__update_fw_upgrade_logger(
"bmc_upgrade", "reboot BMC")
reboot_dict = {}
reboot_dict["reboot"] = "yes"
r = requests.post(self.bmc_info_url, json=reboot_dict)
self.__update_fw_upgrade_logger("bmc_upgrade", "reboot BMC")
if not self.reboot_bmc():
return False
last_fw_upgrade[3] = "DONE"
else:
self.__update_fw_upgrade_logger(
Expand Down Expand Up @@ -754,8 +747,8 @@ def firmware_refresh(self, fpga_list, cpld_list, fw_extra=None):
self.__update_fw_upgrade_logger(
"fw_refresh", "start firmware refresh")

cpld_list = [x.lower() for x in cpld_list] if cpld_list else []
fpga_list = [x.lower() for x in fpga_list] if fpga_list else []
cpld_list = [x.upper() for x in cpld_list] if cpld_list else []
fpga_list = [x.upper() for x in fpga_list] if fpga_list else []
refresh_list = cpld_list + fpga_list
fw_path_list = str(fw_extra).split(':')
refresh_img_list = ["none" for i in range(len(refresh_list))]
Expand All @@ -766,7 +759,7 @@ def firmware_refresh(self, fpga_list, cpld_list, fw_extra=None):
return False

for idx in range(0, len(refresh_list)):
if refresh_list[idx] in ["fan_cpld", "base_cpld"]:
if refresh_list[idx] in ["FAN_CPLD", "BASE_CPLD"]:
if not self.upload_file_bmc(fw_path_list[idx]):
self.__update_fw_upgrade_logger(
"cpld_refresh", "fail, message=Unable to upload refresh image to BMC")
Expand Down

0 comments on commit 9fb4bcd

Please sign in to comment.