Skip to content

Commit 53f7487

Browse files
committed
fix(updater): crash when fetch fails for two architectures
1 parent b48db7d commit 53f7487

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ops2deb/updater.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def find_latest_releases(
240240

241241
# remove blueprint we can't update because we could not fetch associated files
242242
for failure in failures:
243-
releases_by_id.pop(failure.task_data)
243+
releases_by_id.pop(failure.task_data, None)
244244
releases = list(releases_by_id.values())
245245

246246
# add new urls to lock file

tests/test_ops2deb.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def test_update__doesnt_stop_when_server_replies_with_a_500_for_one_url(
766766
assert result.exit_code == 77
767767

768768

769-
def test_update__doesnt_update_blueprint_when_fetch_fails_for_one_architecture(
769+
def test_update__doesnt_update_blueprint_when_fetch_fails_for_two_architectures(
770770
call_ops2deb, configuration_path
771771
):
772772
# Given
@@ -784,6 +784,7 @@ def test_update__doesnt_update_blueprint_when_fetch_fails_for_one_architecture(
784784
url: http://testserver/{{version}}/great-app-{{target}}.tar.gz
785785
targets:
786786
armhf: 404
787+
arm64: 404
787788
script:
788789
- mv great-app {{src}}/usr/bin/great-app
789790
"""

0 commit comments

Comments
 (0)