aboutsummaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-05-28 12:28:44 +0000
committerArne Juul <arnej@verizonmedia.com>2021-05-28 12:28:44 +0000
commit978e21af187d2d98e18d81a39fe5114701898bd4 (patch)
treef45cba4235f62017946fbaa3ee155a832f239701 /configd
parent7da223d13b9bfa2477dfb71012a8f2e0be635ae3 (diff)
just assert for configuration
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/env.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/configd/src/apps/sentinel/env.cpp b/configd/src/apps/sentinel/env.cpp
index b555e6e7b77..11ba20a18d5 100644
--- a/configd/src/apps/sentinel/env.cpp
+++ b/configd/src/apps/sentinel/env.cpp
@@ -30,11 +30,9 @@ Env::~Env() = default;
void Env::boot(const std::string &configId) {
LOG(debug, "Reading configuration for ID: %s", configId.c_str());
_cfgOwner.subscribe(configId, CONFIG_TIMEOUT_MS);
- if (_cfgOwner.checkForConfigUpdate()) {
- LOG_ASSERT(_cfgOwner.hasConfig());
- } else {
- throw InvalidConfigException("checkForConfigUpdate() failed");
- }
+ bool ok = _cfgOwner.checkForConfigUpdate();
+ // subscribe() should throw if something is not OK
+ LOG_ASSERT(ok && _cfgOwner.hasConfig());
const auto & cfg = _cfgOwner.getConfig();
LOG(config, "Booting sentinel '%s' with [stateserver port %d] and [rpc port %d]",
configId.c_str(), cfg.port.telnet, cfg.port.rpc);