Can't we simply add a try block:

def attach_casper_md5check(report, location):
    """Attach the results of the casper md5check of install media."""
    result = "unknown"
    mismatches = []
    if os.path.exists(location):
        attach_root_command_outputs(report, {"CasperMD5json": f"cat 
'{location}'"})
        if "CasperMD5json" in report:
            check = json.loads(report["CasperMD5json"])
            result = check["result"]
            try:
                mismatches = check["checksum_missmatch"]
            except:
                mismatches = []

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2101159

Title:
  Crash in /usr/lib/python3/dist-packages/apport/hookutils.py", line
  1142, in attach_casper_md5check

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2101159/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to