Skip to content

Commit 096247d

Browse files
committed
ExternalCommandProcessor::Execute(): take CheckResultProducer::Ptr
1 parent 0d0fa18 commit 096247d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/compat/externalcommandlistener.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
139139
Log(LogInformation, "ExternalCommandListener")
140140
<< "Executing external command: " << command;
141141

142-
ExternalCommandProcessor::Execute(command);
142+
ExternalCommandProcessor::Execute(this, command);
143143
} catch (const std::exception& ex) {
144144
Log(LogWarning, "ExternalCommandListener")
145145
<< "External command failed: " << DiagnosticInformation(ex, false);

lib/icinga/externalcommandprocessor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using namespace icinga;
2727

2828
boost::signals2::signal<void(double, const String&, const std::vector<String>&)> ExternalCommandProcessor::OnNewExternalCommand;
2929

30-
void ExternalCommandProcessor::Execute(const String& line)
30+
void ExternalCommandProcessor::Execute(const CheckResultProducer::Ptr& producer, const String& line)
3131
{
3232
if (line.IsEmpty())
3333
return;
@@ -54,10 +54,10 @@ void ExternalCommandProcessor::Execute(const String& line)
5454
BOOST_THROW_EXCEPTION(std::invalid_argument("Missing arguments in command: " + line));
5555

5656
std::vector<String> argvExtra(argv.begin() + 1, argv.end());
57-
Execute(ts, argv[0], argvExtra);
57+
Execute(producer, ts, argv[0], argvExtra);
5858
}
5959

60-
void ExternalCommandProcessor::Execute(double time, const String& command, const std::vector<String>& arguments)
60+
void ExternalCommandProcessor::Execute(const CheckResultProducer::Ptr& producer, double time, const String& command, const std::vector<String>& arguments)
6161
{
6262
ExternalCommandInfo eci;
6363

@@ -102,7 +102,7 @@ void ExternalCommandProcessor::Execute(double time, const String& command, const
102102

103103
OnNewExternalCommand(time, command, realArguments);
104104

105-
eci.Callback(time, realArguments);
105+
eci.Callback(producer, time, realArguments);
106106
}
107107

108108
void ExternalCommandProcessor::RegisterCommand(const String& command, const ExternalCommandCallback& callback, size_t minArgs, size_t maxArgs)

lib/icinga/externalcommandprocessor.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ struct ExternalCommandInfo
2525

2626
class ExternalCommandProcessor {
2727
public:
28-
static void Execute(const String& line);
29-
static void Execute(double time, const String& command, const std::vector<String>& arguments);
28+
static void Execute(const CheckResultProducer::Ptr& producer, const String& line);
29+
static void Execute(const CheckResultProducer::Ptr& producer, double time, const String& command, const std::vector<String>& arguments);
3030

3131
static boost::signals2::signal<void(double, const String&, const std::vector<String>&)> OnNewExternalCommand;
3232

0 commit comments

Comments
 (0)