mirror of https://github.com/Icinga/icinga2.git
parent
09a1d4f756
commit
3753f53a67
|
@ -283,8 +283,8 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogInformation, "ApiListener")
|
Log(LogInformation, "ApiListener")
|
||||||
<< "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName() << "' of zone '"
|
<< "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName()
|
||||||
<< origin->FromZone->GetName() << "'";
|
<< "' of zone '" << GetFromZoneName(origin->FromZone) << "'.";
|
||||||
|
|
||||||
Dictionary::Ptr updateV1 = params->Get("update");
|
Dictionary::Ptr updateV1 = params->Get("update");
|
||||||
Dictionary::Ptr updateV2 = params->Get("update_v2");
|
Dictionary::Ptr updateV2 = params->Get("update_v2");
|
||||||
|
|
|
@ -1245,3 +1245,19 @@ bool ApiListener::IsHACluster(void)
|
||||||
return zone->IsSingleInstance();
|
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 void UpdateObjectAuthority(void);
|
||||||
|
|
||||||
static bool IsHACluster(void);
|
static bool IsHACluster(void);
|
||||||
|
static String GetFromZoneName(const Zone::Ptr& fromZone);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OnConfigLoaded(void) override;
|
virtual void OnConfigLoaded(void) override;
|
||||||
|
|
Loading…
Reference in New Issue