Skip to content

Commit

Permalink
no_restore_config ignores excpetion when read_data("firmware")
Browse files Browse the repository at this point in the history
  • Loading branch information
Fellfalla committed May 30, 2022
1 parent 5bbb281 commit 604799b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/python/moteus/moteus_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import tempfile
import time
import uuid
import traceback

from . import moteus
from . import aiostream
Expand Down Expand Up @@ -454,7 +455,14 @@ async def do_flash(self, elffile):

if not self.args.bootloader_active:
# Get the current firmware version.
old_firmware = await self.read_data("firmware")
try:
old_firmware = await self.read_data("firmware")
except RuntimeError as e:
if self.args.no_restore_config:
pass
else:
print(f"Couldn't calpture old config. Consider using --no_restore_config to skip this step.")
raise e

upgrade = FirmwareUpgrade(
elf.firmware_version
Expand Down

0 comments on commit 604799b

Please sign in to comment.