Skip to content

Commit

Permalink
Only run container evaluation when system is running (#3239)
Browse files Browse the repository at this point in the history
* Only run container evaluation when system is running

* adjust test
  • Loading branch information
ludeeus committed Oct 18, 2021
1 parent 6ab4dda commit bb474a5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion supervisor/resolution/evaluations/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def on_failure(self) -> str:
@property
def states(self) -> list[CoreState]:
"""Return a list of valid states when this evaluation can run."""
return [CoreState.SETUP, CoreState.RUNNING, CoreState.INITIALIZE]
return [CoreState.RUNNING]

@property
def known_images(self) -> set[str]:
Expand Down
4 changes: 0 additions & 4 deletions tests/resolution/evaluation/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ async def test_evaluation_setup(coresys: CoreSys):
"supervisor.resolution.evaluations.operating_system.EvaluateOperatingSystem.evaluate",
return_value=False,
) as operating_system, patch(
"supervisor.resolution.evaluations.container.EvaluateContainer.evaluate",
return_value=False,
) as container, patch(
"supervisor.resolution.evaluations.network_manager.EvaluateNetworkManager.evaluate",
return_value=False,
) as network_manager, patch(
Expand All @@ -52,7 +49,6 @@ async def test_evaluation_setup(coresys: CoreSys):
) as systemd:
await coresys.resolution.evaluate.evaluate_system()
operating_system.assert_called_once()
container.assert_called_once()
network_manager.assert_called_once()
systemd.assert_called_once()

Expand Down

0 comments on commit bb474a5

Please sign in to comment.