in client/securedrop_client/export.py [0:0]
def _export_archive_to_whistleflow(cls, archive_path: str) -> ExportStatus | None:
"""
Clone of _export_archive which sends the archive to the Whistleflow VM.
"""
try:
output = subprocess.check_output(
[
quote("qrexec-client-vm"),
quote("--"),
quote("whistleflow-view"),
quote("qubes.Filecopy"),
quote("/usr/lib/qubes/qfile-agent"),
quote(archive_path),
],
stderr=subprocess.STDOUT,
)
result = output.decode("utf-8").strip()
# No status is returned for successful `disk`, `printer-test`, and `print` calls.
# This will change in a future release of sd-export.
if result:
return ExportStatus(result)
else:
return None
except ValueError as e:
logger.debug(f"Export subprocess returned unexpected value: {e}")
raise ExportError(ExportStatus.UNEXPECTED_RETURN_STATUS)
except subprocess.CalledProcessError as e:
logger.error("Subprocess failed")
logger.debug(f"Subprocess failed: {e}")
raise ExportError(ExportStatus.CALLED_PROCESS_ERROR)