]> granicus.if.org Git - icinga2/commitdiff
Add missing attributes for dependent objects
authorGunnar Beutner <gunnar@beutner.name>
Tue, 18 Aug 2015 17:39:10 +0000 (19:39 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 18 Aug 2015 17:39:10 +0000 (19:39 +0200)
refs #9082

lib/remote/configobjectutility.cpp

index 18b865b3ccfa5e2fddc9bf5aae3694b56e6326f0..a87cecf6ffaf829e7ed174f1e6e1259900087b52 100644 (file)
@@ -130,8 +130,13 @@ bool ConfigObjectUtility::CreateObject(const Type::Ptr& type, const String& full
 
        path += "/" + EscapeName(fullName) + ".conf";
        
+       Dictionary::Ptr allAttrs = new Dictionary();
+       attrs->CopyTo(allAttrs);
+       nameParts->CopyTo(allAttrs);
+       allAttrs->Remove("name");
+
        ConfigWriter::Ptr cw = new ConfigWriter(path);
-       cw->EmitConfigItem(type->GetName(), name, false, templates, attrs);
+       cw->EmitConfigItem(type->GetName(), name, false, templates, allAttrs);
        cw->EmitRaw("\n");
        
        return true;