mirror of https://github.com/Icinga/icinga2.git
Don't accept config updates for zones for which we have an authoritative copy of the config
fixes #8555
This commit is contained in:
parent
3046ad5d5e
commit
4e16f48255
|
@ -31,7 +31,7 @@ using namespace icinga;
|
|||
|
||||
REGISTER_APIFUNCTION(Update, config, &ApiListener::ConfigUpdateHandler);
|
||||
|
||||
bool ApiListener::IsConfigMaster(const Zone::Ptr& zone) const
|
||||
bool ApiListener::IsConfigMaster(const Zone::Ptr& zone)
|
||||
{
|
||||
String path = Application::GetZonesDir() + "/" + zone->GetName();
|
||||
return Utility::PathExists(path);
|
||||
|
@ -233,7 +233,13 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin& origin, const Dictio
|
|||
|
||||
if (!zone) {
|
||||
Log(LogWarning, "ApiListener")
|
||||
<< "Ignoring config update for unknown zone: " << kv.first;
|
||||
<< "Ignoring config update for unknown zone '" << kv.first << "'.";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsConfigMaster(zone)) {
|
||||
Log(LogWarning, "ApiListener")
|
||||
<< "Ignoring config update for zone '" << kv.first << "' because we have an authoritative version of the zone's config.";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ private:
|
|||
void SyncZoneDirs(void) const;
|
||||
void SyncZoneDir(const Zone::Ptr& zone) const;
|
||||
|
||||
bool IsConfigMaster(const Zone::Ptr& zone) const;
|
||||
static bool IsConfigMaster(const Zone::Ptr& zone);
|
||||
static void ConfigGlobHandler(Dictionary::Ptr& config, const String& path, const String& file);
|
||||
void SendConfigUpdate(const ApiClient::Ptr& aclient);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue