]> granicus.if.org Git - icinga2/commitdiff
Fix some minor issues with the icinga2.debug feature
authorGunnar Beutner <gunnar.beutner@netways.de>
Sat, 16 Aug 2014 20:12:40 +0000 (22:12 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sat, 16 Aug 2014 20:12:40 +0000 (22:12 +0200)
refs #6702

debian/control
lib/config/aexpression.cpp

index 7a7c94a7b700c62ead0ba783685ffdbadbbb9023..b46a8ea5f3e50b909b99470610dab8bb823c3697 100644 (file)
@@ -243,7 +243,7 @@ Architecture: all
 Section: python
 Priority: extra
 Depends: ${misc:Depends}, ${python:Depends}
-Description: host and network monitoring system - debug symbols
+Description: host and network monitoring system - Python module
  Icinga 2 is a general-purpose monitoring application and the next generation
  after Icinga 1.x - which was a Nagios fork. It should fit the needs of a small
  environment as well as big installations.
index df4b703416997f961936110bc45137016fde36c9..5269d5928a947c8b225dd162b3e2ba88e3479f5b 100644 (file)
@@ -312,10 +312,17 @@ Value AExpression::OpDict(const AExpression *expr, const Dictionary::Ptr& locals
 Value AExpression::OpSet(const AExpression *expr, const Dictionary::Ptr& locals, DebugHint *dhint)
 {
        Value index = expr->EvaluateOperand1(locals);
-       DebugHint *sdhint = dhint->GetChild(index);
+
+       DebugHint *sdhint = NULL;
+       if (dhint)
+               sdhint = dhint->GetChild(index);
+
        Value right = expr->EvaluateOperand2(locals, sdhint);
        locals->Set(index, right);
-       sdhint->AddMessage("=", expr->m_DebugInfo);
+
+       if (sdhint)
+               sdhint->AddMessage("=", expr->m_DebugInfo);
+
        return right;
 }
 
@@ -335,7 +342,10 @@ Value AExpression::OpSetPlus(const AExpression *expr, const Dictionary::Ptr& loc
                xlocals->Set("__parent", locals);
        }
 
-       DebugHint *sdhint = dhint->GetChild(index);
+       DebugHint *sdhint = NULL;
+       if (dhint)
+               sdhint = dhint->GetChild(index);
+
        Value result = left + expr->EvaluateOperand2(xlocals, sdhint);
 
        if (exp_right->m_Operator == &AExpression::OpDict) {
@@ -344,7 +354,9 @@ Value AExpression::OpSetPlus(const AExpression *expr, const Dictionary::Ptr& loc
        }
 
        locals->Set(index, result);
-       sdhint->AddMessage("+=", expr->m_DebugInfo);
+
+       if (sdhint)
+               sdhint->AddMessage("+=", expr->m_DebugInfo);
 
        return result;
 }
@@ -365,7 +377,10 @@ Value AExpression::OpSetMinus(const AExpression *expr, const Dictionary::Ptr& lo
                xlocals->Set("__parent", locals);
        }
 
-       DebugHint *sdhint = dhint->GetChild(index);
+       DebugHint *sdhint = NULL;
+       if (dhint)
+               sdhint = dhint->GetChild(index);
+
        Value result = left - expr->EvaluateOperand2(xlocals, sdhint);
 
        if (exp_right->m_Operator == &AExpression::OpDict) {
@@ -374,7 +389,9 @@ Value AExpression::OpSetMinus(const AExpression *expr, const Dictionary::Ptr& lo
        }
 
        locals->Set(index, result);
-       sdhint->AddMessage("-=", expr->m_DebugInfo);
+
+       if (sdhint)
+               sdhint->AddMessage("-=", expr->m_DebugInfo);
 
        return result;
 }
@@ -395,7 +412,10 @@ Value AExpression::OpSetMultiply(const AExpression *expr, const Dictionary::Ptr&
                xlocals->Set("__parent", locals);
        }
 
-       DebugHint *sdhint = dhint->GetChild(index);
+       DebugHint *sdhint = NULL;
+       if (dhint)
+               sdhint = dhint->GetChild(index);
+
        Value result = left * expr->EvaluateOperand2(xlocals, sdhint);
 
        if (exp_right->m_Operator == &AExpression::OpDict) {
@@ -404,7 +424,9 @@ Value AExpression::OpSetMultiply(const AExpression *expr, const Dictionary::Ptr&
        }
 
        locals->Set(index, result);
-       sdhint->AddMessage("*=", expr->m_DebugInfo);
+
+       if (sdhint)
+               sdhint->AddMessage("*=", expr->m_DebugInfo);
 
        return result;
 }
@@ -425,7 +447,10 @@ Value AExpression::OpSetDivide(const AExpression *expr, const Dictionary::Ptr& l
                xlocals->Set("__parent", locals);
        }
 
-       DebugHint *sdhint = dhint->GetChild(index);
+       DebugHint *sdhint = NULL;
+       if (dhint)
+               sdhint = dhint->GetChild(index);
+
        Value result = left / expr->EvaluateOperand2(xlocals, sdhint);
 
        if (exp_right->m_Operator == &AExpression::OpDict) {
@@ -434,7 +459,9 @@ Value AExpression::OpSetDivide(const AExpression *expr, const Dictionary::Ptr& l
        }
 
        locals->Set(index, result);
-       sdhint->AddMessage("/=", expr->m_DebugInfo);
+
+       if (sdhint)
+               sdhint->AddMessage("/=", expr->m_DebugInfo);
 
        return result;
 }