mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-23 09:48:05 +02:00
Indicate and handle left out zones in config::Update
This commit is contained in:
parent
3449e73e9f
commit
7066e2610a
@ -762,6 +762,27 @@ Value ApiListener::ConfigWantFilesHandler(const MessageOrigin::Ptr& origin, cons
|
|||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto& zone : ConfigType::GetObjectsByType<Zone>()) {
|
||||||
|
auto zoneName (zone->GetName());
|
||||||
|
|
||||||
|
if (!zone->IsChildOf(clientZone) && !zone->IsGlobal()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Utility::PathExists(zonesDir + zoneName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configUpdateV1->Contains(zoneName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not requested? Not included!
|
||||||
|
configUpdateV1->Set(zoneName, Empty);
|
||||||
|
configUpdateV2->Set(zoneName, Empty);
|
||||||
|
configUpdateChecksums->Set(zoneName, Empty);
|
||||||
|
}
|
||||||
|
|
||||||
JsonRpcConnection::Ptr client;
|
JsonRpcConnection::Ptr client;
|
||||||
|
|
||||||
for (auto& conn : endpoint->GetClients()) {
|
for (auto& conn : endpoint->GetClients()) {
|
||||||
@ -960,8 +981,15 @@ void ApiListener::HandleConfigUpdate(const MessageOrigin::Ptr& origin, const Dic
|
|||||||
Utility::MkDirP(productionConfigZoneDir, 0700);
|
Utility::MkDirP(productionConfigZoneDir, 0700);
|
||||||
Utility::MkDirP(stageConfigZoneDir, 0700);
|
Utility::MkDirP(stageConfigZoneDir, 0700);
|
||||||
|
|
||||||
|
// Load the current production config details.
|
||||||
|
ConfigDirInformation productionConfigInfo = LoadConfigDir(productionConfigZoneDir);
|
||||||
|
|
||||||
// Merge the config information.
|
// Merge the config information.
|
||||||
ConfigDirInformation newConfigInfo;
|
ConfigDirInformation newConfigInfo;
|
||||||
|
|
||||||
|
if (kv.second.GetType() == ValueEmpty) {
|
||||||
|
newConfigInfo = productionConfigInfo;
|
||||||
|
} else {
|
||||||
newConfigInfo.UpdateV1 = kv.second;
|
newConfigInfo.UpdateV1 = kv.second;
|
||||||
|
|
||||||
// Load metadata.
|
// Load metadata.
|
||||||
@ -999,9 +1027,7 @@ void ApiListener::HandleConfigUpdate(const MessageOrigin::Ptr& origin, const Dic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Load the current production config details.
|
|
||||||
ConfigDirInformation productionConfigInfo = LoadConfigDir(productionConfigZoneDir);
|
|
||||||
|
|
||||||
// Merge updateV1 and updateV2
|
// Merge updateV1 and updateV2
|
||||||
Dictionary::Ptr productionConfig = MergeConfigUpdate(productionConfigInfo);
|
Dictionary::Ptr productionConfig = MergeConfigUpdate(productionConfigInfo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user