Retry bodhi updates download a few times if it fails

It's failing about one in six tries currently, with Bodhi 5.5 on
the server end: https://github.com/fedora-infra/bodhi/issues/4105
this should work around that.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-08-13 15:03:36 -07:00
parent 41ddac0951
commit 0557a774ac

View File

@ -446,7 +446,18 @@ sub setup_workaround_repo {
# then we'll download each update for our release:
my $advisories = $workarounds{$version};
foreach my $advisory (@$advisories) {
assert_script_run "bodhi updates download --updateid=$advisory", 180;
my $count = 3;
my $success = 0;
while ($count) {
if (script_run "bodhi updates download --updateid=$advisory", 180) {
$count -= 1;
}
else {
$count = 0;
$success = 1;
}
}
die "Workaround update download failed!" unless $success;
}
# and create repo metadata
assert_script_run "createrepo .";