From f43440404beb1d10a48b1e9ff2e53ba4aa577956 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 19 Jul 2026 06:47:10 +0200 Subject: [PATCH] Use supported manager reload option --- src/apps/config/tests/test_cli.py | 10 ++++++++++ src/apps/manager/manager.c | 2 +- src/libs/python/bongo/configuration/cli.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/apps/config/tests/test_cli.py b/src/apps/config/tests/test_cli.py index 1aed54f..96b7db4 100644 --- a/src/apps/config/tests/test_cli.py +++ b/src/apps/config/tests/test_cli.py @@ -66,6 +66,16 @@ def configurations(): class ConfigurationCliTest(unittest.TestCase): + def test_manager_reload_uses_supported_short_option(self): + completed = mock.Mock(returncode=0) + with mock.patch.object(cli, "_manager_binary", + return_value=Path("/usr/sbin/bongo-manager")), \ + mock.patch.object(cli.subprocess, "run", + return_value=completed) as run: + cli._reload_manager() + run.assert_called_once_with( + ["/usr/sbin/bongo-manager", "-r"], check=False, timeout=120) + def test_verified_scanner_activation_is_saved_before_manager_reload(self): store = FakeStore() original = configurations() diff --git a/src/apps/manager/manager.c b/src/apps/manager/manager.c index 3543db9..33380a1 100644 --- a/src/apps/manager/manager.c +++ b/src/apps/manager/manager.c @@ -1811,7 +1811,7 @@ ShowHelp(void) "\t-k: Keep agents alive, restarting them after crashes.\n" "\t-f: Force start, replacing " LOCKFILE ".\n" "\t-s: Shut down an already-running bongo-manager.\n" - "\t-r: Ask a running bongo-manager to restart stopped agents.\n") + "\t-r: Synchronize configuration and restart stopped agents.\n") ); } diff --git a/src/libs/python/bongo/configuration/cli.py b/src/libs/python/bongo/configuration/cli.py index 87bb7fb..9066faf 100644 --- a/src/libs/python/bongo/configuration/cli.py +++ b/src/libs/python/bongo/configuration/cli.py @@ -60,7 +60,7 @@ def _reload_manager() -> None: manager = _manager_binary() try: completed = subprocess.run( - [str(manager), "--reload"], check=False, timeout=120) + [str(manager), "-r"], check=False, timeout=120) except (OSError, subprocess.TimeoutExpired) as error: raise ConfigurationError( f"cannot request Bongo manager reload: {error}") from error