mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
Merge pull request #10417 from Icinga/inverted-hacluster-check
Fix inverted `IsHACluster` check
This commit is contained in:
commit
a65f2d6b41
@ -1927,11 +1927,7 @@ void ApiListener::ValidateTlsHandshakeTimeout(const Lazy<double>& lvalue, const
|
|||||||
bool ApiListener::IsHACluster()
|
bool ApiListener::IsHACluster()
|
||||||
{
|
{
|
||||||
Zone::Ptr zone = Zone::GetLocalZone();
|
Zone::Ptr zone = Zone::GetLocalZone();
|
||||||
|
return zone && zone->IsHACluster();
|
||||||
if (!zone)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return zone->IsSingleInstance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Provide a helper function for zone origin name. */
|
/* Provide a helper function for zone origin name. */
|
||||||
|
@ -125,10 +125,10 @@ bool Zone::IsGlobal() const
|
|||||||
return GetGlobal();
|
return GetGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Zone::IsSingleInstance() const
|
bool Zone::IsHACluster() const
|
||||||
{
|
{
|
||||||
Array::Ptr endpoints = GetEndpointsRaw();
|
auto endpoints = GetEndpointsRaw();
|
||||||
return !endpoints || endpoints->GetLength() < 2;
|
return endpoints && endpoints->GetLength() >= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Zone::Ptr Zone::GetLocalZone()
|
Zone::Ptr Zone::GetLocalZone()
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
bool CanAccessObject(const ConfigObject::Ptr& object);
|
bool CanAccessObject(const ConfigObject::Ptr& object);
|
||||||
bool IsChildOf(const Zone::Ptr& zone);
|
bool IsChildOf(const Zone::Ptr& zone);
|
||||||
bool IsGlobal() const;
|
bool IsGlobal() const;
|
||||||
bool IsSingleInstance() const;
|
bool IsHACluster() const;
|
||||||
|
|
||||||
static Zone::Ptr GetLocalZone();
|
static Zone::Ptr GetLocalZone();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user