mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-23 17:57:54 +02:00
modified-attributes.conf: store attributes to modify in Internal.modified_attributes
This commit is contained in:
parent
a65f2d6b41
commit
9c00ae53b3
@ -36,7 +36,9 @@ INITIALIZE_ONCE_WITH_PRIORITY([]() {
|
|||||||
l_StatsNS = new Namespace(true);
|
l_StatsNS = new Namespace(true);
|
||||||
globalNS->Set("StatsFunctions", l_StatsNS, true);
|
globalNS->Set("StatsFunctions", l_StatsNS, true);
|
||||||
|
|
||||||
globalNS->Set("Internal", new Namespace(), true);
|
Namespace::Ptr intNS = new Namespace();
|
||||||
|
intNS->Set("modified_attributes", new Dictionary(), true);
|
||||||
|
globalNS->Set("Internal", intNS, true);
|
||||||
}, InitializePriority::CreateNamespaces);
|
}, InitializePriority::CreateNamespaces);
|
||||||
|
|
||||||
INITIALIZE_ONCE_WITH_PRIORITY([]() {
|
INITIALIZE_ONCE_WITH_PRIORITY([]() {
|
||||||
|
@ -135,15 +135,11 @@ static void PersistModAttrHelper(AtomicFile& fp, ConfigObject::Ptr& previousObje
|
|||||||
ConfigWriter::EmitRaw(fp, "\n}\n\n");
|
ConfigWriter::EmitRaw(fp, "\n}\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigWriter::EmitRaw(fp, "var obj = ");
|
ConfigWriter::EmitRaw(fp, "Internal.modified_attributes[");
|
||||||
|
ConfigWriter::EmitValue(fp, 0, object->GetReflectionType()->GetName());
|
||||||
Array::Ptr args1 = new Array({
|
ConfigWriter::EmitRaw(fp, "][");
|
||||||
object->GetReflectionType()->GetName(),
|
ConfigWriter::EmitValue(fp, 0, object->GetName());
|
||||||
object->GetName()
|
ConfigWriter::EmitRaw(fp, "] = obj => {\n");
|
||||||
});
|
|
||||||
ConfigWriter::EmitFunctionCall(fp, "get_object", args1);
|
|
||||||
|
|
||||||
ConfigWriter::EmitRaw(fp, "\nif (obj) {\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigWriter::EmitRaw(fp, "\tobj.");
|
ConfigWriter::EmitRaw(fp, "\tobj.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user