Skip to content

Commit

Permalink
IcingaApplication::DumpModifiedAttributes(): pass original value to P…
Browse files Browse the repository at this point in the history
…ersistModAttrHelper() as well

refs #8717
  • Loading branch information
Al2Klimov committed Aug 11, 2021
1 parent 95be500 commit 09244bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/icinga/icingaapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void IcingaApplication::OnShutdown()
DumpProgramState();
}

static void PersistModAttrHelper(std::fstream& fp, ConfigObject::Ptr& previousObject, const ConfigObject::Ptr& object, const String& attr, const Value& value)
static void PersistModAttrHelper(std::fstream& fp, ConfigObject::Ptr& previousObject, const ConfigObject::Ptr& object, const String& attr, const Value& original, const Value& modified)
{
if (object != previousObject) {
if (previousObject) {
Expand All @@ -145,7 +145,7 @@ static void PersistModAttrHelper(std::fstream& fp, ConfigObject::Ptr& previousOb

Array::Ptr args2 = new Array({
attr,
value
modified
});
ConfigWriter::EmitFunctionCall(fp, "modify_attribute", args2);

Expand Down Expand Up @@ -175,8 +175,8 @@ void IcingaApplication::DumpModifiedAttributes()
fp.exceptions(std::ofstream::failbit | std::ofstream::badbit);

ConfigObject::Ptr previousObject;
ConfigObject::DumpModifiedAttributes([&fp, &previousObject](const ConfigObject::Ptr& object, const String& attr, const Value&, const Value& value) {
PersistModAttrHelper(fp, previousObject, object, attr, value);
ConfigObject::DumpModifiedAttributes([&fp, &previousObject](const ConfigObject::Ptr& object, const String& attr, const Value& original, const Value& modified) {
PersistModAttrHelper(fp, previousObject, object, attr, original, modified);
});

if (previousObject) {
Expand Down

0 comments on commit 09244bc

Please sign in to comment.