| 167 | } |
| 168 | |
| 169 | void 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 | |
| 195 | IcingaApplication::Ptr IcingaApplication::GetInstance() |
| 196 | { |
nothing calls this directly
no test coverage detected