]> granicus.if.org Git - icinga2/commitdiff
Implement "accept_config" attribute.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 15 May 2014 08:13:32 +0000 (10:13 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 15 May 2014 08:13:32 +0000 (10:13 +0200)
Refs #6191

lib/remote/apilistener-sync.cpp
lib/remote/apilistener.ti
lib/remote/remote-type.conf

index 6938d24ab9c3115b03c1262a2fabba09551e6604..78ae5cf060e0084352e980c42205ddf75b0c4901 100644 (file)
@@ -158,6 +158,11 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin& origin, const Dictio
        if (!origin.FromZone || !Zone::GetLocalZone()->IsChildOf(origin.FromZone))
                return Empty;
 
+       ApiListener::Ptr listener = ApiListener::GetInstance();
+
+       if (!listener || !listener->GetAcceptConfig())
+               return Empty;
+
        Dictionary::Ptr update = params->Get("update");
 
        bool configChange = false;
index 381536c3344764930fcddf2d0c739f62c68373e0..be7cd6b15db67091141bb736d5bc73b19d9e95f2 100644 (file)
@@ -16,6 +16,8 @@ class ApiListener : DynamicObject
                default {{{ return "5665"; }}}
        };
 
+       [config] bool accept_config;
+
        [state] double log_message_timestamp;
 
        String identity;
index bdf58db5fda58adaece21868950ba4aee832025e..b458ccd5e38d7f05f90e6daf28deae3d2edc8f46 100644 (file)
@@ -31,6 +31,8 @@
 
        %attribute %string "bind_host",
        %attribute %string "bind_port",
+
+       %attribute %number "accept_config"
 }
 
 %type Endpoint {