Skip to content

Commit

Permalink
ConfigObject::DumpModifiedAttributes(): pass original value to callba…
Browse files Browse the repository at this point in the history
…ck as well

refs #8717
  • Loading branch information
Al2Klimov committed Apr 22, 2021
1 parent d9ae615 commit 93693ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/base/configobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ void ConfigObject::StopObjects()
}
}

void ConfigObject::DumpModifiedAttributes(const std::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback)
void ConfigObject::DumpModifiedAttributes(const std::function<void(const ConfigObject::Ptr&, const String&, const Value&, const Value&)>& callback)
{
for (const Type::Ptr& type : Type::GetAllTypes()) {
auto *dtype = dynamic_cast<ConfigType *>(type.get());
Expand Down Expand Up @@ -703,7 +703,7 @@ void ConfigObject::DumpModifiedAttributes(const std::function<void(const ConfigO
} else
modifiedValue = currentValue;

callback(object, key, modifiedValue);
callback(object, key, kv.second, modifiedValue);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/base/configobject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ConfigObject : public ObjectImpl<ConfigObject>
static void RestoreObjects(const String& filename, int attributeTypes = FAState);
static void StopObjects();

static void DumpModifiedAttributes(const std::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback);
static void DumpModifiedAttributes(const std::function<void(const ConfigObject::Ptr&, const String&, const Value&, const Value&)>& callback);

static Object::Ptr GetPrototype();

Expand Down
2 changes: 1 addition & 1 deletion lib/icinga/icingaapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ 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& value) {
ConfigObject::DumpModifiedAttributes([&fp, &previousObject](const ConfigObject::Ptr& object, const String& attr, const Value&, const Value& value) {
PersistModAttrHelper(fp, previousObject, object, attr, value);
});

Expand Down

0 comments on commit 93693ba

Please sign in to comment.