Commit ab624de
committed
[FIX] hw_drivers: drivers deleted on bad response
Before this commit, if the IoT box was connected a DB which then went
offline (e.g. expired runbot), and it tried to download drivers, the
request would fail but it would still delete the old handlers.
After this commit, we avoid this problem in two ways. Firstly, we check
that we received an OK HTTP status before trying to process the response
body. Secondly, we check that the reponse we have received is a valid
zip file BEFORE deleting the old handlers. This way we only delete them
if we are sure we have something to replace them with.
task-4933638
closes odoo#218661
X-original-commit: 63d5ab8
Signed-off-by: Max Whale (mawh) <mawh@odoo.com>
Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>1 parent 143ad2e commit ab624de
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
449 | 452 | | |
| 453 | + | |
450 | 454 | | |
| 455 | + | |
451 | 456 | | |
452 | | - | |
453 | | - | |
454 | 457 | | |
| 458 | + | |
| 459 | + | |
455 | 460 | | |
456 | 461 | | |
457 | 462 | | |
| |||
0 commit comments