Drop Checkable#process_check_result() DSL function

Not sure why it's introduced in the first place, maybe for debugging
purposes at the early stage of Icinga 2 dev but I failed to see an
actual useful use case for it that's worth its maintenance burden. So,
this commit dropped it entirely from the DSL language.
This commit is contained in:
Yonas Habteab 2025-05-26 13:57:09 +02:00
parent bcf43208c6
commit 9577af8e6d
4 changed files with 2 additions and 37 deletions

View File

@ -30,7 +30,7 @@ set(icinga_SOURCES
checkable.cpp checkable.hpp checkable-ti.hpp
checkable-check.cpp checkable-comment.cpp checkable-dependency.cpp
checkable-downtime.cpp checkable-event.cpp checkable-flapping.cpp
checkable-notification.cpp checkable-script.cpp
checkable-notification.cpp
checkcommand.cpp checkcommand.hpp checkcommand-ti.hpp
checkresult.cpp checkresult.hpp checkresult-ti.hpp
cib.cpp cib.hpp

View File

@ -1,33 +0,0 @@
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#include "icinga/checkable.hpp"
#include "base/configobject.hpp"
#include "base/dictionary.hpp"
#include "base/function.hpp"
#include "base/functionwrapper.hpp"
#include "base/scriptframe.hpp"
#include "remote/apilistener.hpp"
using namespace icinga;
static void CheckableProcessCheckResult(const CheckResult::Ptr& cr)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Checkable::Ptr self = vframe->Self;
REQUIRE_NOT_NULL(self);
if (cr) {
auto api (ApiListener::GetInstance());
self->ProcessCheckResult(cr, api ? api->GetWaitGroup() : new StoppableWaitGroup());
}
}
Object::Ptr Checkable::GetPrototype()
{
static Dictionary::Ptr prototype = new Dictionary({
{ "process_check_result", new Function("Checkable#process_check_result", CheckableProcessCheckResult, { "cr" }, false) }
});
return prototype;
}

View File

@ -12,7 +12,7 @@
using namespace icinga;
REGISTER_TYPE_WITH_PROTOTYPE(Checkable, Checkable::GetPrototype());
REGISTER_TYPE(Checkable);
INITIALIZE_ONCE(&Checkable::StaticInitialize);
const std::map<String, int> Checkable::m_FlappingStateFilterMap ({

View File

@ -214,8 +214,6 @@ public:
static int GetPendingChecks();
static void AquirePendingCheckSlot(int maxPendingChecks);
static Object::Ptr GetPrototype();
protected:
void Start(bool runtimeCreated) override;
void OnConfigLoaded() override;