]> granicus.if.org Git - icinga2/commitdiff
Move endpoint error check to ti file
authorJean Flach <jean-marcel.flach@netways.de>
Tue, 25 Aug 2015 15:06:08 +0000 (17:06 +0200)
committerJean Flach <jean-marcel.flach@netways.de>
Tue, 25 Aug 2015 15:06:08 +0000 (17:06 +0200)
refs #9623

lib/remote/endpoint.cpp
lib/remote/endpoint.hpp
lib/remote/endpoint.ti

index bdbfed08835146520a80f744f2c573b7f31a538e..29068ac0d235c6fcd39c14fe22d68a5de0714303 100644 (file)
@@ -57,14 +57,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<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 JsonRpcConnection::Ptr& client)
 {
        bool was_master = ApiListener::GetInstance()->IsMaster();
index cd8aac1175ec28ce40e9e0befe06e5fe01185625..0738572fe9049f47b5249ba60a705ad79377c91e 100644 (file)
@@ -56,7 +56,6 @@ public:
 
 protected:
        virtual void OnAllConfigLoaded(void) override;
-       virtual void ValidatePort(const String& value, const ValidationUtils& utils) override;
 
 private:
        mutable boost::mutex m_ClientsLock;
index 9625d9b66a6b50ce67783545606e5e29e8e39f7a..eab3fb7390a95ad97245a313bc28feb491b81907 100644 (file)
@@ -27,7 +27,7 @@ namespace icinga
 class Endpoint : ConfigObject
 {
        [config] String host;
-       [config] String port {
+       [config, required] String port {
                default {{{ return "5665"; }}}
        };
        [config] double log_duration {