mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Merge pull request #10457 from Icinga/remove-superfluous-dsl-functions
Drop superfluous (broken) DSL functions
This commit is contained in:
commit
dcd9a2dd41
@ -11,7 +11,6 @@
|
|||||||
#include "base/objectlock.hpp"
|
#include "base/objectlock.hpp"
|
||||||
#include "base/configtype.hpp"
|
#include "base/configtype.hpp"
|
||||||
#include "base/application.hpp"
|
#include "base/application.hpp"
|
||||||
#include "base/dependencygraph.hpp"
|
|
||||||
#include "base/initialize.hpp"
|
#include "base/initialize.hpp"
|
||||||
#include "base/namespace.hpp"
|
#include "base/namespace.hpp"
|
||||||
#include "config/configitem.hpp"
|
#include "config/configitem.hpp"
|
||||||
@ -49,7 +48,6 @@ REGISTER_SAFE_FUNCTION(System, basename, &Utility::BaseName, "path");
|
|||||||
REGISTER_SAFE_FUNCTION(System, dirname, &Utility::DirName, "path");
|
REGISTER_SAFE_FUNCTION(System, dirname, &Utility::DirName, "path");
|
||||||
REGISTER_SAFE_FUNCTION(System, getenv, &ScriptUtils::GetEnv, "value");
|
REGISTER_SAFE_FUNCTION(System, getenv, &ScriptUtils::GetEnv, "value");
|
||||||
REGISTER_SAFE_FUNCTION(System, msi_get_component_path, &ScriptUtils::MsiGetComponentPathShim, "component");
|
REGISTER_SAFE_FUNCTION(System, msi_get_component_path, &ScriptUtils::MsiGetComponentPathShim, "component");
|
||||||
REGISTER_SAFE_FUNCTION(System, track_parents, &ScriptUtils::TrackParents, "child");
|
|
||||||
REGISTER_SAFE_FUNCTION(System, escape_shell_cmd, &Utility::EscapeShellCmd, "cmd");
|
REGISTER_SAFE_FUNCTION(System, escape_shell_cmd, &Utility::EscapeShellCmd, "cmd");
|
||||||
REGISTER_SAFE_FUNCTION(System, escape_shell_arg, &Utility::EscapeShellArg, "arg");
|
REGISTER_SAFE_FUNCTION(System, escape_shell_arg, &Utility::EscapeShellArg, "arg");
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -518,11 +516,6 @@ String ScriptUtils::MsiGetComponentPathShim(const String& component)
|
|||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr ScriptUtils::TrackParents(const Object::Ptr& child)
|
|
||||||
{
|
|
||||||
return Array::FromVector(DependencyGraph::GetChildren(dynamic_pointer_cast<ConfigObject>(child)));
|
|
||||||
}
|
|
||||||
|
|
||||||
double ScriptUtils::Ptr(const Object::Ptr& object)
|
double ScriptUtils::Ptr(const Object::Ptr& object)
|
||||||
{
|
{
|
||||||
return reinterpret_cast<intptr_t>(object.get());
|
return reinterpret_cast<intptr_t>(object.get());
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
static Array::Ptr GetObjects(const Type::Ptr& type);
|
static Array::Ptr GetObjects(const Type::Ptr& type);
|
||||||
static void Assert(const Value& arg);
|
static void Assert(const Value& arg);
|
||||||
static String MsiGetComponentPathShim(const String& component);
|
static String MsiGetComponentPathShim(const String& component);
|
||||||
static Array::Ptr TrackParents(const Object::Ptr& parent);
|
|
||||||
static double Ptr(const Object::Ptr& object);
|
static double Ptr(const Object::Ptr& object);
|
||||||
static Value Glob(const std::vector<Value>& args);
|
static Value Glob(const std::vector<Value>& args);
|
||||||
static Value GlobRecursive(const std::vector<Value>& args);
|
static Value GlobRecursive(const std::vector<Value>& args);
|
||||||
|
@ -30,7 +30,7 @@ set(icinga_SOURCES
|
|||||||
checkable.cpp checkable.hpp checkable-ti.hpp
|
checkable.cpp checkable.hpp checkable-ti.hpp
|
||||||
checkable-check.cpp checkable-comment.cpp checkable-dependency.cpp
|
checkable-check.cpp checkable-comment.cpp checkable-dependency.cpp
|
||||||
checkable-downtime.cpp checkable-event.cpp checkable-flapping.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
|
checkcommand.cpp checkcommand.hpp checkcommand-ti.hpp
|
||||||
checkresult.cpp checkresult.hpp checkresult-ti.hpp
|
checkresult.cpp checkresult.hpp checkresult-ti.hpp
|
||||||
cib.cpp cib.hpp
|
cib.cpp cib.hpp
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
REGISTER_TYPE_WITH_PROTOTYPE(Checkable, Checkable::GetPrototype());
|
REGISTER_TYPE(Checkable);
|
||||||
INITIALIZE_ONCE(&Checkable::StaticInitialize);
|
INITIALIZE_ONCE(&Checkable::StaticInitialize);
|
||||||
|
|
||||||
const std::map<String, int> Checkable::m_FlappingStateFilterMap ({
|
const std::map<String, int> Checkable::m_FlappingStateFilterMap ({
|
||||||
|
@ -216,8 +216,6 @@ public:
|
|||||||
static int GetPendingChecks();
|
static int GetPendingChecks();
|
||||||
static void AquirePendingCheckSlot(int maxPendingChecks);
|
static void AquirePendingCheckSlot(int maxPendingChecks);
|
||||||
|
|
||||||
static Object::Ptr GetPrototype();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Start(bool runtimeCreated) override;
|
void Start(bool runtimeCreated) override;
|
||||||
void OnConfigLoaded() override;
|
void OnConfigLoaded() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user