Skip to content

Commit 604799b

Browse files
committed
no_restore_config ignores excpetion when read_data("firmware")
1 parent 5bbb281 commit 604799b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/python/moteus/moteus_tool.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import tempfile
3131
import time
3232
import uuid
33+
import traceback
3334

3435
from . import moteus
3536
from . import aiostream
@@ -454,7 +455,14 @@ async def do_flash(self, elffile):
454455

455456
if not self.args.bootloader_active:
456457
# Get the current firmware version.
457-
old_firmware = await self.read_data("firmware")
458+
try:
459+
old_firmware = await self.read_data("firmware")
460+
except RuntimeError as e:
461+
if self.args.no_restore_config:
462+
pass
463+
else:
464+
print(f"Couldn't calpture old config. Consider using --no_restore_config to skip this step.")
465+
raise e
458466

459467
upgrade = FirmwareUpgrade(
460468
elf.firmware_version

0 commit comments

Comments
 (0)