qvm-template: handle template extraction failure

QubesOS/qubes-issues#2534
This commit is contained in:
Marek Marczykowski-Górecki 2021-01-29 22:59:14 +01:00
parent f3954fb225
commit aeeb3daa80
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -907,8 +907,9 @@ def install(
for rpmfile, reponame, name, package_hdr in verified_rpm_list: for rpmfile, reponame, name, package_hdr in verified_rpm_list:
with tempfile.TemporaryDirectory(dir=TEMP_DIR) as target: with tempfile.TemporaryDirectory(dir=TEMP_DIR) as target:
print('Installing template \'%s\'...' % name, file=sys.stderr) print('Installing template \'%s\'...' % name, file=sys.stderr)
# FIXME: Handle return value if not extract_rpm(name, rpmfile, target):
extract_rpm(name, rpmfile, target) raise Exception(
'Failed to extract {} template'.format(name))
cmdline = [ cmdline = [
'qvm-template-postprocess', 'qvm-template-postprocess',
'--really', '--really',