From 6665d6d80fea390fe34f2e844bf18ba9603cd3d2 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 17 Jun 2016 13:20:15 +0200 Subject: [PATCH] ConfigJob: fix dealing with currently active config --- library/Director/Job/ConfigJob.php | 5 +++-- library/Director/Objects/DirectorDeploymentLog.php | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/library/Director/Job/ConfigJob.php b/library/Director/Job/ConfigJob.php index 9e217eaa..3cf7c2f4 100644 --- a/library/Director/Job/ConfigJob.php +++ b/library/Director/Job/ConfigJob.php @@ -29,6 +29,8 @@ class ConfigJob extends JobHook if ($this->shouldDeploy($config)) { $this->deploy($config); } + + $this->clearLastDeployment(); } protected function api() @@ -83,7 +85,7 @@ class ConfigJob extends JobHook return false; } - if ($this->getActiveChecksum() === $config->getChecksum()) { + if ($this->getActiveChecksum() === $config->getHexChecksum()) { return false; } @@ -94,7 +96,6 @@ class ConfigJob extends JobHook protected function deploy(IcingaConfig $config) { - $this->clearLastDeployment(); $db = $this->db(); $api = $this->api(); $api->wipeInactiveStages($db); diff --git a/library/Director/Objects/DirectorDeploymentLog.php b/library/Director/Objects/DirectorDeploymentLog.php index 16966d1f..a81dc879 100644 --- a/library/Director/Objects/DirectorDeploymentLog.php +++ b/library/Director/Objects/DirectorDeploymentLog.php @@ -76,10 +76,7 @@ class DirectorDeploymentLog extends DbObject $db = $connection->getDbAdapter(); $query = $db->select() ->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum'))) - ->where('stage_name = ?') - ->where('stage_collected IS NULL') - ->where('startup_succeeded IS NULL') - ->order('stage_name'); + ->where('stage_name = ?'); return $db->fetchOne($query, $stage); }