Browse Source

qvm-template: handle template extraction failure

QubesOS/qubes-issues#2534
Marek Marczykowski-Górecki 3 years ago
parent
commit
aeeb3daa80
1 changed files with 3 additions and 2 deletions
  1. 3 2
      qubesadmin/tools/qvm_template.py

+ 3 - 2
qubesadmin/tools/qvm_template.py

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