]> granicus.if.org Git - icinga2/commitdiff
Fix parameter order for Acknowledge{,Svc,Host}Problem in API actions/external commands
authorFederico Cuello <federico.cuello@sociomantic.com>
Fri, 11 Aug 2017 12:39:47 +0000 (14:39 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 5 Sep 2017 09:16:17 +0000 (11:16 +0200)
It was preventing email notifications with default settings, as `persistent` defaults to false and therefore `notify` was not set.

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
refs #5495

lib/icinga/apiactions.cpp
lib/icinga/externalcommandprocessor.cpp

index d488cd5996c6fed826e94da219a62faa8d51a959..da544ddeafe864559813ba497ca285ce0ab9a9b4 100644 (file)
@@ -226,7 +226,7 @@ Dictionary::Ptr ApiActions::AcknowledgeProblem(const ConfigObject::Ptr& object,
        Comment::AddComment(checkable, CommentAcknowledgement, HttpUtility::GetLastParameter(params, "author"),
            HttpUtility::GetLastParameter(params, "comment"), persistent, timestamp);
        checkable->AcknowledgeProblem(HttpUtility::GetLastParameter(params, "author"),
-           HttpUtility::GetLastParameter(params, "comment"), sticky, notify, timestamp);
+           HttpUtility::GetLastParameter(params, "comment"), sticky, notify, persistent, timestamp);
 
        return ApiActions::CreateResult(200, "Successfully acknowledged problem for object '" + checkable->GetName() + "'.");
 }
index 04977924fca44213fb997627890f203ab1e61dac..6c3469f76c4761e3f2e36c0b49e950588de19510 100644 (file)
@@ -635,7 +635,7 @@ void ExternalCommandProcessor::AcknowledgeSvcProblem(double, const std::vector<S
            << "Setting acknowledgement for service '" << service->GetName() << "'" << (notify ? "" : ". Disabled notification");
 
        Comment::AddComment(service, CommentAcknowledgement, arguments[5], arguments[6], persistent, 0);
-       service->AcknowledgeProblem(arguments[5], arguments[6], sticky ? AcknowledgementSticky : AcknowledgementNormal, persistent, notify);
+       service->AcknowledgeProblem(arguments[5], arguments[6], sticky ? AcknowledgementSticky : AcknowledgementNormal, notify, persistent);
 }
 
 void ExternalCommandProcessor::AcknowledgeSvcProblemExpire(double, const std::vector<String>& arguments)
@@ -699,7 +699,7 @@ void ExternalCommandProcessor::AcknowledgeHostProblem(double, const std::vector<
                BOOST_THROW_EXCEPTION(std::invalid_argument("The host '" + arguments[0] + "' is OK."));
 
        Comment::AddComment(host, CommentAcknowledgement, arguments[4], arguments[5], persistent, 0);
-       host->AcknowledgeProblem(arguments[4], arguments[5], sticky ? AcknowledgementSticky : AcknowledgementNormal, persistent, notify);
+       host->AcknowledgeProblem(arguments[4], arguments[5], sticky ? AcknowledgementSticky : AcknowledgementNormal, notify, persistent);
 }
 
 void ExternalCommandProcessor::AcknowledgeHostProblemExpire(double, const std::vector<String>& arguments)