From f71a2ca34019ec728160b0deabf5b03e85bb56dc Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Tue, 25 Aug 2015 17:06:08 +0200 Subject: [PATCH] Move endpoint error check to ti file refs #9623 Conflicts: lib/remote/endpoint.cpp lib/remote/endpoint.hpp --- lib/remote/endpoint.cpp | 8 -------- lib/remote/endpoint.hpp | 1 - lib/remote/endpoint.ti | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/remote/endpoint.cpp b/lib/remote/endpoint.cpp index 9332aa922..a7a9e7afe 100644 --- a/lib/remote/endpoint.cpp +++ b/lib/remote/endpoint.cpp @@ -56,14 +56,6 @@ 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::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(); diff --git a/lib/remote/endpoint.hpp b/lib/remote/endpoint.hpp index f2dd73275..3411b32aa 100644 --- a/lib/remote/endpoint.hpp +++ b/lib/remote/endpoint.hpp @@ -56,7 +56,6 @@ public: protected: virtual void OnAllConfigLoaded(void); - virtual void ValidatePort(const String& value, const ValidationUtils& utils) override; private: mutable boost::mutex m_ClientsLock; diff --git a/lib/remote/endpoint.ti b/lib/remote/endpoint.ti index 5866d36f7..21f58402c 100644 --- a/lib/remote/endpoint.ti +++ b/lib/remote/endpoint.ti @@ -25,7 +25,7 @@ namespace icinga class Endpoint : DynamicObject { [config] String host; - [config] String port { + [config, required] String port { default {{{ return "5665"; }}} }; [config] double log_duration {