mirror of https://github.com/Icinga/icinga2.git
Merge pull request #5249 from Icinga/fix/cluster-log-crash
Fix cluster crash w/ config sync fixes #5212
This commit is contained in:
commit
4ad1d1cd43
|
@ -283,8 +283,8 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
|
|||
}
|
||||
|
||||
Log(LogInformation, "ApiListener")
|
||||
<< "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName() << "' of zone '"
|
||||
<< origin->FromZone->GetName() << "'";
|
||||
<< "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName()
|
||||
<< "' of zone '" << GetFromZoneName(origin->FromZone) << "'.";
|
||||
|
||||
Dictionary::Ptr updateV1 = params->Get("update");
|
||||
Dictionary::Ptr updateV2 = params->Get("update_v2");
|
||||
|
|
|
@ -1245,3 +1245,19 @@ bool ApiListener::IsHACluster(void)
|
|||
return zone->IsSingleInstance();
|
||||
}
|
||||
|
||||
/* Provide a helper function for zone origin name. */
|
||||
String ApiListener::GetFromZoneName(const Zone::Ptr& fromZone)
|
||||
{
|
||||
String fromZoneName;
|
||||
|
||||
if (fromZone) {
|
||||
fromZoneName = fromZone->GetName();
|
||||
} else {
|
||||
Zone::Ptr lzone = Zone::GetLocalZone();
|
||||
|
||||
if (lzone)
|
||||
fromZoneName = lzone->GetName();
|
||||
}
|
||||
|
||||
return fromZoneName;
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ public:
|
|||
static void UpdateObjectAuthority(void);
|
||||
|
||||
static bool IsHACluster(void);
|
||||
static String GetFromZoneName(const Zone::Ptr& fromZone);
|
||||
|
||||
protected:
|
||||
virtual void OnConfigLoaded(void) override;
|
||||
|
|
Loading…
Reference in New Issue