mirror of https://github.com/Icinga/icinga2.git
Add config error on empty port in Endpoints
fixes #9623 Conflicts: lib/remote/endpoint.cpp lib/remote/endpoint.hpp
This commit is contained in:
parent
c298261bbf
commit
0513be27b4
|
@ -56,6 +56,14 @@ void Endpoint::OnAllConfigLoaded(void)
|
|||
BOOST_THROW_EXCEPTION(ScriptError("Endpoint '" + GetName() + "' does not belong to a zone.", GetDebugInfo()));
|
||||
}
|
||||
|
||||
void Endpoint::ValidatePort(const String& value, const ValidationUtils& utils)
|
||||
{
|
||||
ObjectImpl<Endpoint>::ValidatePort(value, utils);
|
||||
|
||||
if (value.IsEmpty())
|
||||
BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("enpoint_port"), "Port may not be empty."));
|
||||
}
|
||||
|
||||
void Endpoint::AddClient(const ApiClient::Ptr& client)
|
||||
{
|
||||
bool was_master = ApiListener::GetInstance()->IsMaster();
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void OnAllConfigLoaded(void);
|
||||
virtual void ValidatePort(const String& value, const ValidationUtils& utils) override;
|
||||
|
||||
private:
|
||||
mutable boost::mutex m_ClientsLock;
|
||||
|
|
Loading…
Reference in New Issue