mirror of
https://github.com/Icinga/icinga2.git
synced 2025-06-24 23:50:21 +02:00
Fix Expression::Extract.
This commit is contained in:
parent
969458b480
commit
45e24e4729
@ -220,16 +220,17 @@ void Expression::Extract(const std::vector<String>& path, const ExpressionList::
|
||||
ASSERT(!path.empty());
|
||||
|
||||
if (path[0] == m_Key) {
|
||||
if (path.size() == 1) {
|
||||
result->AddExpression(*this);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_Value.IsObjectType<ExpressionList>())
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Specified path does not exist."));
|
||||
|
||||
ExpressionList::Ptr exprl = m_Value;
|
||||
|
||||
if (path.size() == 1) {
|
||||
result->AddExpression(Expression("", OperatorExecute, exprl, m_DebugInfo));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<String> sub_path(path.begin() + 1, path.end());
|
||||
exprl->Extract(sub_path, result);
|
||||
} else if (m_Operator == OperatorExecute) {
|
||||
|
@ -643,6 +643,8 @@ void Service::BeginExecuteCheck(const boost::function<void (void)>& callback)
|
||||
{
|
||||
ASSERT(!OwnsLock());
|
||||
|
||||
bool reachable = IsReachable();
|
||||
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
||||
@ -660,10 +662,9 @@ void Service::BeginExecuteCheck(const boost::function<void (void)>& callback)
|
||||
|
||||
SetLastState(GetState());
|
||||
SetLastStateType(GetLastStateType());
|
||||
SetLastReachable(reachable);
|
||||
}
|
||||
|
||||
SetLastReachable(IsReachable());
|
||||
|
||||
/* keep track of scheduling info in case the check type doesn't provide its own information */
|
||||
Dictionary::Ptr checkInfo = boost::make_shared<Dictionary>();
|
||||
checkInfo->Set("schedule_start", GetNextCheck());
|
||||
|
Loading…
x
Reference in New Issue
Block a user