Skip to content

Commit 9ade2c1

Browse files
committed
Better handling of configuration change.
1 parent 3df7f73 commit 9ade2c1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

PyFunceble/cli/processes/base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,3 @@ class ProcessesManagerBase(PyFunceble.ext.process_manager.ProcessManagerCore):
6060
"""
6161
Provides the base of all classes.
6262
"""
63-
64-
def __post_init__(self):
65-
self._extra_args["configuration"] = PyFunceble.storage.CONFIGURATION.to_dict()
66-
67-
return super().__post_init__()

PyFunceble/cli/processes/workers/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,13 @@ def perform_external_poweron_checks(self) -> bool:
9595
Perform the external poweron checks.
9696
"""
9797

98-
if self.configuration is not None:
98+
if hasattr(self, "configuration") and self.configuration is not None:
9999
PyFunceble.facility.ConfigLoader.set_custom_config(self.configuration)
100100

101-
if multiprocessing.get_start_method() != "fork":
101+
if (
102+
multiprocessing.get_start_method() != "fork"
103+
or not PyFunceble.storage.CONFIGURATION
104+
):
102105
PyFunceble.facility.ConfigLoader.start()
103106
PyFunceble.cli.facility.CredentialLoader.start()
104107
PyFunceble.cli.factory.DBSession.init_db_sessions()

PyFunceble/cli/processes/workers/producer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ class ProducerWorker(WorkerBase):
103103
)
104104

105105
def perform_external_poweron_checks(self) -> None:
106+
result = super().perform_external_poweron_checks()
107+
106108
skip_columns = []
107109
extra_formatters = {}
108110

@@ -135,7 +137,7 @@ def perform_external_poweron_checks(self) -> None:
135137

136138
self.header_already_printed = False
137139

138-
return super().perform_external_poweron_checks()
140+
return result
139141

140142
@staticmethod
141143
def should_we_ignore(test_result: CheckerStatusBase) -> bool:

0 commit comments

Comments
 (0)