Skip to content

Commit 059cf28

Browse files
committed
fixup! Fix preloading issue.
1 parent 019ccb9 commit 059cf28

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

PyFunceble/cli/system/launcher.py

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -660,18 +660,19 @@ def remove_unwanted_files(self) -> "SystemLauncher":
660660
def remove_running_file(protocol: str) -> None:
661661
"""
662662
Removes the running file.
663-
664-
:param protocol:
665-
The protocol to work with.
663+
:param parent_dirname:
664+
The name of the directory to work from (under the output
665+
directory).
666666
"""
667667

668-
file_helper.set_path(
669-
os.path.join(
670-
protocol["output_dir"],
671-
PyFunceble.cli.storage.TEST_RUNNING_FILE,
672-
)
673-
).delete()
674-
PyFunceble.facility.Logger.debug("Deleted: %r.", file_helper.path)
668+
if protocol["output_dir"]:
669+
file_helper.set_path(
670+
os.path.join(
671+
protocol["output_dir"],
672+
PyFunceble.cli.storage.TEST_RUNNING_FILE,
673+
)
674+
).delete()
675+
PyFunceble.facility.Logger.debug("Deleted: %r.", file_helper.path)
675676

676677
def remove_trigger_file(protocol: str) -> None:
677678
"""
@@ -681,13 +682,14 @@ def remove_trigger_file(protocol: str) -> None:
681682
The protocol to work with.
682683
"""
683684

684-
file_helper.set_path(
685-
os.path.join(
686-
protocol["output_dir"],
687-
PyFunceble.cli.storage.CI_TRIGGER_FILE,
688-
)
689-
).delete()
690-
PyFunceble.facility.Logger.debug("Deleted: %r.", file_helper.path)
685+
if protocol["output_dir"]:
686+
file_helper.set_path(
687+
os.path.join(
688+
protocol["output_dir"],
689+
PyFunceble.cli.storage.CI_TRIGGER_FILE,
690+
)
691+
).delete()
692+
PyFunceble.facility.Logger.debug("Deleted: %r.", file_helper.path)
691693

692694
def remove_continue_dataset(protocol: dict) -> None:
693695
"""
@@ -697,13 +699,16 @@ def remove_continue_dataset(protocol: dict) -> None:
697699
The protocol to work with.
698700
"""
699701

700-
if isinstance(self.continue_dataset, CSVContinueDataset):
702+
if (
703+
isinstance(self.continue_dataset, CSVContinueDataset)
704+
and protocol["output_dir"]
705+
):
701706
# CSV file :-)
702707
self.continue_dataset.set_base_directory(protocol["output_dir"])
703708
file_helper.set_path(self.continue_dataset.source_file).delete()
704709

705710
PyFunceble.facility.Logger.debug("Deleted: %r.", file_helper.path)
706-
else:
711+
elif protocol["destination"]:
707712
# MariaDB / MySQL
708713

709714
# ## We specially have different signature.
@@ -719,7 +724,7 @@ def remove_preload_dataset(protocol: dict) -> None:
719724
The protocol to work with.
720725
"""
721726

722-
if self.file_preloader.authorized:
727+
if self.file_preloader.authorized and protocol["output_dir"]:
723728
file_helper.set_path(
724729
os.path.join(
725730
protocol["output_dir"],
@@ -875,7 +880,9 @@ def start(self) -> "SystemLauncher":
875880

876881
del self.migrator_process_manager
877882

878-
if not self.file_preloader.authorized:
883+
if not self.file_preloader.authorized or (
884+
not self.args.files and not self.args.url_files
885+
):
879886
self.__start_core_processes()
880887

881888
self.fill_protocol()

0 commit comments

Comments
 (0)