diff --git a/securedrop_export/export.py b/securedrop_export/export.py index dce797e..e430c9d 100755 --- a/securedrop_export/export.py +++ b/securedrop_export/export.py @@ -23,6 +23,7 @@ class Metadata(object): METADATA_FILE = "metadata.json" SUPPORTED_EXPORT_METHODS = [ + "start-vm", "usb-test", # general preflight check "disk", "disk-test", # disk preflight test diff --git a/securedrop_export/main.py b/securedrop_export/main.py index c2c5df3..bfaae2f 100755 --- a/securedrop_export/main.py +++ b/securedrop_export/main.py @@ -20,7 +20,7 @@ def __main__(submission): submission.exit_gracefully(ExportStatus.ERROR_ARCHIVE_METADATA.value) if submission.archive_metadata.export_method == "start-vm": - return # Export VM is running + submission.exit_gracefully('') # Export VM is running elif submission.archive_metadata.export_method == "usb-test": action = USBTestAction(submission) elif submission.archive_metadata.export_method == "disk": diff --git a/securedrop_export/print/actions.py b/securedrop_export/print/actions.py index 917596b..0d688b1 100644 --- a/securedrop_export/print/actions.py +++ b/securedrop_export/print/actions.py @@ -50,20 +50,17 @@ def check_printer_setup(self) -> None: def print_test_page(self): logger.info('Printing test page') - self._print_file("/usr/share/cups/data/testprint") - self.submission.popup_message("Printing test page") + self.print_file("/usr/share/cups/data/testprint") def print_all_files(self): - logger.info('Printing files') files_path = os.path.join(self.submission.tmpdir, "export_data/") files = os.listdir(files_path) print_count = 0 for f in files: file_path = os.path.join(files_path, f) - self._print_file(file_path) + self.print_file(file_path) print_count += 1 - msg = "Printing document {} of {}".format(print_count, len(files)) - self.submission.popup_message(msg) + logger.info("Printing document {} of {}".format(print_count, len(files))) def _install_printer_ppd(self, uri: str): if "Brother" in uri: @@ -133,21 +130,7 @@ def _setup_printer(self, printer_uri, printer_ppd): error_message=ExportStatus.ERROR_PRINTER_INSTALL.value ) - def print_test_page(self): - logger.info('Printing test page') - self.print_file("/usr/share/cups/data/testprint") - - def print_all_files(self): - files_path = os.path.join(self.submission.tmpdir, "export_data/") - files = os.listdir(files_path) - print_count = 0 - for f in files: - file_path = os.path.join(files_path, f) - self.print_file(file_path) - print_count += 1 - logger.info("Printing document {} of {}".format(print_count, len(files))) - - def is_open_office_file(self, filename): + def _is_open_office_file(self, filename): OPEN_OFFICE_FORMATS = [ ".doc", ".docx",