]> granicus.if.org Git - icinga2/commitdiff
Cleaned up configrpc.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 20 Apr 2012 13:49:12 +0000 (15:49 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 20 Apr 2012 13:49:12 +0000 (15:49 +0200)
components/configrpc/configrpccomponent.cpp

index 1f85e505c5ba62157449fa2f04d48c37c14fd11e..365568de8f1d93069af2a3858b0e2bcacc04b649 100644 (file)
@@ -85,14 +85,8 @@ JsonRpcRequest ConfigRpcComponent::MakeObjectMessage(const ConfigObject::Ptr& ob
        params.GetDictionary()->SetPropertyString("name", object->GetName());
        params.GetDictionary()->SetPropertyString("type", object->GetType());
 
-       if (includeProperties) {
-               Message properties;
-               params.GetDictionary()->SetPropertyDictionary("properties", properties.GetDictionary());
-
-               for (ConfigObject::ParameterIterator pi = object->Properties.begin(); pi != object->Properties.end(); pi++) {
-                       properties.GetDictionary()->SetPropertyString(pi->first, pi->second);
-               }
-       }
+       if (includeProperties)
+               params.SetPropertyMessage("properties", Message(object));
 
        return msg;
 }
@@ -101,7 +95,7 @@ bool ConfigRpcComponent::ShouldReplicateObject(const ConfigObject::Ptr& object)
 {
        long replicate;
        if (!object->GetPropertyInteger("replicate", &replicate))
-               return false;
+               return true;
        return (replicate != 0);
 }