MCPcopy Create free account
hub / github.com/Icinga/icinga2 / DumpModifiedAttributes

Method DumpModifiedAttributes

lib/icinga/icingaapplication.cpp:169–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void IcingaApplication::DumpModifiedAttributes()
170{
171 String path = Configuration::ModAttrPath;
172
173 try {
174 Utility::Glob(path + ".tmp.*", &Utility::Remove, GlobFile);
175 } catch (const std::exception& ex) {
176 Log(LogWarning, "IcingaApplication") << DiagnosticInformation(ex);
177 }
178
179 AtomicFile fp (path, 0644);
180
181 ConfigObject::Ptr previousObject;
182 ConfigObject::DumpModifiedAttributes([&fp, &previousObject](const ConfigObject::Ptr& object, const String& attr, const Value& value) {
183 PersistModAttrHelper(fp, previousObject, object, attr, value);
184 });
185
186 if (previousObject) {
187 ConfigWriter::EmitRaw(fp, "\tobj.version = ");
188 ConfigWriter::EmitValue(fp, 0, previousObject->GetVersion());
189 ConfigWriter::EmitRaw(fp, "\n}\n");
190 }
191
192 fp.Commit();
193}
194
195IcingaApplication::Ptr IcingaApplication::GetInstance()
196{

Callers

nothing calls this directly

Calls 3

LogClass · 0.85
PersistModAttrHelperFunction · 0.85
CommitMethod · 0.45

Tested by

no test coverage detected