]> 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:10:20 +0000 (17:10 +0200)
refs #9623

Conflicts:
lib/remote/endpoint.cpp
lib/remote/endpoint.hpp

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

index 9332aa9226f74f4c3d2bce44df835ab492b78210..a7a9e7afe6d246a2f749a524cef84064980f6e67 100644 (file)
@@ -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<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();
index f2dd732758af8013b4d31ad13a181c8978615c63..3411b32aa1b643694b46540b63008f8f77c8505e 100644 (file)
@@ -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;
index 5866d36f7a9e3209f2f99cffa0b276bace56707f..21f58402c0ca32fe30fc203502e7a78131e81099 100644 (file)
@@ -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 {