Skip to content

Commit

Permalink
update firmware related text information output
Browse files Browse the repository at this point in the history
  • Loading branch information
qinchuanares committed Nov 18, 2021
1 parent 8a4cb6c commit f877036
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1325,14 +1325,18 @@ def module_fw_download(self, startLPLsize, maxblocksize, lplonly_flag, autopagin
# complete FW download (CMD 0107h)
fw_complete_status = self.cdb.validate_fw_image()
if fw_complete_status == 1:
logger.info('Module FW download complete: Success')
string = 'Module FW download complete: Success'
logger.info(string)
txt += string
else:
txt += 'Module FW download complete: Fail\n'
txt += 'FW_complete_status %d\n' %fw_complete_status
logger.info(txt)
return False, txt
elapsedtime = time.time()-elapsedtime-starttime
logger.info('Complete module FW download time: %.2f s\n' %elapsedtime)
string = 'Complete module FW download time: %.2f s\n' %elapsedtime
logger.info(string)
txt += string
return True, txt

def module_fw_upgrade(self, imagepath):
Expand Down Expand Up @@ -1394,11 +1398,11 @@ def module_fw_switch(self):
txt += 'Before switch Image A: %s; Run: %d Commit: %d, Valid: %d\n' %(
ImageA_init, ImageARunning_init, ImageACommitted_init, ImageAValid_init
)
txt += 'Befpre switch Image B: %s; Run: %d Commit: %d, Valid: %d\n' %(
txt += 'Before switch Image B: %s; Run: %d Commit: %d, Valid: %d\n' %(
ImageB_init, ImageBRunning_init, ImageBCommitted_init, ImageBValid_init
)
txt += 'Image A: %s; Run: %d Commit: %d, Valid: %d\n' %(ImageA, ImageARunning, ImageACommitted, ImageAValid)
txt += 'Image B: %s; Run: %d Commit: %d, Valid: %d\n' %(ImageB, ImageBRunning, ImageBCommitted, ImageBValid)
txt += 'After switch Image A: %s; Run: %d Commit: %d, Valid: %d\n' %(ImageA, ImageARunning, ImageACommitted, ImageAValid)
txt += 'After switch Image B: %s; Run: %d Commit: %d, Valid: %d\n' %(ImageB, ImageBRunning, ImageBCommitted, ImageBValid)
if (ImageARunning_init == 1 and ImageARunning == 1) or (ImageBRunning_init == 1 and ImageBRunning == 1):
txt += 'Switch did not happen.\n'
logger.info(txt)
Expand Down

0 comments on commit f877036

Please sign in to comment.