1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-22 05:53:09 +00:00

short-circuit copy_devcdrom_as_isofile if no ISO_URL

There are some situations in which ISO_URL is not set (e.g. a
manual POST to re-run tests after download has been done). If
there is no ISO_URL just skip the checksum check here.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2019-08-15 19:05:59 -07:00
parent d71daa1fe4
commit 150812c15c

View File

@ -887,6 +887,9 @@ sub copy_devcdrom_as_isofile {
assert_script_run "dd if=/dev/cdrom of=$isoname", 360;
# verify iso checksum
my $cdurl = get_var('ISO_URL');
# ISO_URL may not be set if we POSTed manually or something; just assume
# we're OK in that case
return unless $cdurl;
my $cmd = <<EOF;
urld="$cdurl"; urld=\${urld%/*}; chkf=\$(curl -fs \$urld/ |grep CHECKSUM | sed -E 's/.*href=.//; s/\".*//') && curl -f \$urld/\$chkf -o /tmp/x
chkref=\$(grep -E 'SHA256.*dvd' /tmp/x | sed -e 's/.*= //') && echo "\$chkref $isoname" >/tmp/x