change a var name

This commit is contained in:
Oskar Weigl
2018-10-08 16:55:59 -07:00
parent 5df64ed513
commit 3cc8c09339
+3 -3
View File
@@ -338,8 +338,8 @@ def update_device(device, firmware, logger, cancellation_token):
# Back up configuration
if dfudev is None:
did_backup_config = device.user_config_loaded if hasattr(device, 'user_config_loaded') else False
if did_backup_config:
do_backup_config = device.user_config_loaded if hasattr(device, 'user_config_loaded') else False
if do_backup_config:
odrive.configuration.backup_config(device, None, logger)
elif not odrive.utils.yes_no_prompt("The configuration cannot be backed up because the device is already in DFU mode. The configuration may be lost after updating. Do you want to continue anyway?", True):
raise OperationAbortedException()
@@ -414,7 +414,7 @@ def update_device(device, firmware, logger, cancellation_token):
device = odrive.find_any("usb", serial_number,
cancellation_token, cancellation_token, timeout=30)
if did_backup_config:
if do_backup_config:
odrive.configuration.restore_config(device, None, logger)
os.remove(odrive.configuration.get_temp_config_filename(device))