Skip to content

Commit

Permalink
Merge pull request #62 from Dasharo/fix_flashing_messages
Browse files Browse the repository at this point in the history
osfv_cli/src/osfv: Fix success message on flashing fail
  • Loading branch information
miczyg1 authored Sep 6, 2024
2 parents 4507066 + ae047f5 commit af5f5be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions osfv_cli/src/osfv/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,11 @@ def flash_read(rte, args):

def flash_write(rte, args):
print(f"Writing {args.rom} to flash...")
rte.flash_write(args.rom)
print(f"Flash written")
rc = rte.flash_write(args.rom)
if rc == 0:
print(f"Flash written successfully")
else:
print(f"Flash write failed with code {rc}")


def flash_erase(rte, args):
Expand Down
5 changes: 4 additions & 1 deletion osfv_cli/src/osfv/rf/rte_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ def rte_flash_write(self, fw_file):
"""Writes file from ``fw_file`` path into DUT flash chip"""
robot.api.logger.info(f"Writing {fw_file} to flash...")
rc = self.rte.flash_write(fw_file)
robot.api.logger.info(f"Flash written")
if rc == 0:
robot.api.logger.info(f"Flash written successfully")
else:
robot.api.logger.info(f"Flash write failed with code {rc}")
return rc

@keyword(types=None)
Expand Down

0 comments on commit af5f5be

Please sign in to comment.