mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Fix macros substitutions
This commit is contained in:
parent
44fc841ee1
commit
604b938ade
@ -619,8 +619,9 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object,
|
|||||||
endpoint = HttpUtility::GetLastParameter(params, "endpoint");
|
endpoint = HttpUtility::GetLastParameter(params, "endpoint");
|
||||||
|
|
||||||
MacroProcessor::ResolverList resolvers;
|
MacroProcessor::ResolverList resolvers;
|
||||||
|
Value macros;
|
||||||
if (params->Contains("macros")) {
|
if (params->Contains("macros")) {
|
||||||
Value macros = HttpUtility::GetLastParameter(params, "macros");
|
macros = HttpUtility::GetLastParameter(params, "macros");
|
||||||
if (macros.IsObjectType<Dictionary>()) {
|
if (macros.IsObjectType<Dictionary>()) {
|
||||||
resolvers.emplace_back("override", macros);
|
resolvers.emplace_back("override", macros);
|
||||||
}
|
}
|
||||||
@ -673,7 +674,7 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object,
|
|||||||
/* Check if resolved_command exists and it is of type command_type */
|
/* Check if resolved_command exists and it is of type command_type */
|
||||||
Dictionary::Ptr execMacros = new Dictionary();
|
Dictionary::Ptr execMacros = new Dictionary();
|
||||||
|
|
||||||
MacroResolver::OverrideMacros = execMacros;
|
MacroResolver::OverrideMacros = macros;
|
||||||
Defer o ([]() {
|
Defer o ([]() {
|
||||||
MacroResolver::OverrideMacros = nullptr;
|
MacroResolver::OverrideMacros = nullptr;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user