mirror of https://github.com/Icinga/icinga2.git
Unify how to take macros parameter
This commit is contained in:
parent
e4e0115c9d
commit
94be948ff6
|
@ -572,8 +572,9 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object,
|
||||||
|
|
||||||
MacroProcessor::ResolverList resolvers;
|
MacroProcessor::ResolverList resolvers;
|
||||||
if (params->Contains("macros")) {
|
if (params->Contains("macros")) {
|
||||||
if (params->Get("macros").IsObjectType<Dictionary>())
|
Value macros = HttpUtility::GetLastParameter(params, "macros");
|
||||||
resolvers.emplace_back("override",HttpUtility::GetLastParameter(params, "macros"));
|
if (macros.IsObjectType<Dictionary>())
|
||||||
|
resolvers.emplace_back("override", macros);
|
||||||
else
|
else
|
||||||
return ApiActions::CreateResult(400, "Parameter macros must be a dictionary.");
|
return ApiActions::CreateResult(400, "Parameter macros must be a dictionary.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue