Use supported manager reload option
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user