[icinga-checkins] icinga.org: icingaweb2-module-director/feature-ddo-playground: StateObject : inherit DdoObject, fix checkresult

git at icinga.org git at icinga.org
Tue Jul 19 10:31:52 CEST 2016


Module: icingaweb2-module-director
Branch: feature-ddo-playground
Commit: 71c1d3aa0ce033b00e9827342e74e465f8a7241d
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=71c1d3aa0ce033b00e9827342e74e465f8a7241d

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Jun 21 13:40:05 2016 +0200

StateObject: inherit DdoObject, fix checkresult

---

 library/Director/Ddo/StateObject.php |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/library/Director/Ddo/StateObject.php b/library/Director/Ddo/StateObject.php
index 77e243b..999d0a5 100644
--- a/library/Director/Ddo/StateObject.php
+++ b/library/Director/Ddo/StateObject.php
@@ -2,10 +2,7 @@
 
 namespace Icinga\Module\Director\Ddo;
 
-use Icinga\Module\Director\Data\Db\DbObject;
-use Icinga\Module\Director\Ddo\DdoDb;
-
-abstract class StateObject extends DbObject
+abstract class StateObject extends DdoObject
 {
     const FLAG_DOWNTIME   = 1;
     const FLAG_ACK        = 2;
@@ -39,9 +36,10 @@ abstract class StateObject extends DbObject
 
     public function processCheckResult($result)
     {
-        $vars = $result->vars_after;
+        $checkResult = $result->check_result;
+        $vars = $checkResult->vars_after;
 
-        $this->state      = $result->state;
+        $this->state      = $checkResult->state;
         $this->state_type = $vars->state_type;
         $this->reachable  = $vars->reachable;
         $this->attempt    = $vars->attempt;



More information about the icinga-checkins mailing list