Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openwisp_firmware_upgrader/tests/test_openwrt_upgrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def mocked_exec_upgrade_success_false_positives(
filename = command.split()[-1].split("/")[-1]
raise CommandFailedException(
"Command failed: ubus call system sysupgrade "
'{ "prefix": "\/tmp\/root", '
f'"path": "\/tmp\/{filename}", '
'"backup": "\/tmp\/sysupgrade.tgz", '
'"command": "\/lib\/upgrade\/do_stage2", '
'{ "prefix": "/tmp/root", '
f'"path": "/tmp/{filename}", '
'"backup": "/tmp/sysupgrade.tgz", '
'"command": "/lib/upgrade/do_stage2", '
'"options": { "save_partitions": 1 } } '
"(Connection failed)"
)
Expand Down
14 changes: 7 additions & 7 deletions openwisp_firmware_upgrader/upgraders/openwrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ class OpenWrt(object):

_false_positives = [
"Command failed: ubus call system sysupgrade "
'\{ "prefix": "\\\/tmp\\\/root", "path": "[^"]*", '
'"backup": "\\\/tmp\\\/sysupgrade.tgz", '
'"command": "\\\/lib\\\/upgrade\\\/do_stage2", '
'"options": \{ "save_partitions": 1 \} \}',
r'\{ "prefix": "\\?/tmp\\?/root", "path": "[^"]*", '
r'"backup": "\\?/tmp\\?/sysupgrade.tgz", '
r'"command": "\\?/lib\\?/upgrade\\?/do_stage2", '
r'"options": \{ "save_partitions": 1 \} \}',
"Command failed: ubus call system sysupgrade "
'\{ "prefix": "\\\/tmp\\\/root", "path": "[^"]*", '
'"command": "\\\/lib\\\/upgrade\\\/do_stage2", '
'"options": \{ "save_partitions": 1 \} \}',
r'\{ "prefix": "\\?/tmp\\?/root", "path": "[^"]*", '
r'"command": "\\?/lib\\?/upgrade\\?/do_stage2", '
r'"options": \{ "save_partitions": 1 \} \}',
]

def __init__(self, upgrade_operation, connection):
Expand Down
Loading