def METHOD_NAME(self, pathname):
    """Mount image with hdiutil."""
    # Make sure we don't try to mount something twice.
    if pathname in self.mounts:
        raise ProcessorError(f"{pathname} is already mounted")
    stdin = ""
    if self.dmg_has_sla(pathname):
        stdin = "Y\n"
    # Call hdiutil.
    try:
        proc = subprocess.Popen(
            (
                "/usr/bin/hdiutil",
                "attach",
                "-plist",
                "-mountrandom",
                "/private/tmp",
                "-nobrowse",
                pathname,
            ),
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            stdin=subprocess.PIPE,
            text=True,
        )
        (stdout, stderr) = proc.communicate(stdin)
    except OSError as err:
        raise ProcessorError(
            f"hdiutil execution failed with error code {err.errno}: {err.strerror}"
        )
    if proc.returncode != 0:
        raise ProcessorError(f"mounting {pathname} failed: {stderr}")
    # Read output plist.
    (pliststr, stdout) = self.get_first_plist(stdout)
    try:
        output = plistlib.loads(pliststr.encode())
    except Exception:
        raise ProcessorError(
            f"mounting {pathname} failed: unexpected output from hdiutil"
        )
    # Find mount point.
    for part in output.get("system-entities", []):
        if "mount-point" in part:
            # Add to mount list.
            self.mounts[pathname] = part["mount-point"]
            self.output(f"Mounted disk image {pathname}")
            return self.mounts[pathname]
    raise ProcessorError(
        f"mounting {pathname} failed: unexpected output from hdiutil"
    )