mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
DeploymentStatus: little fix, formatting
This commit is contained in:
parent
251cd309be
commit
31a66b6619
@ -74,8 +74,8 @@ class DeploymentStatus
|
|||||||
{
|
{
|
||||||
$db = $this->db->getDbAdapter();
|
$db = $this->db->getDbAdapter();
|
||||||
$query = $db->select()->from(
|
$query = $db->select()->from(
|
||||||
array('l' => 'director_deployment_log'),
|
['l' => 'director_deployment_log'],
|
||||||
array('checksum' => $this->db->dbHexFunc('l.config_checksum'))
|
['checksum' => $this->db->dbHexFunc('l.config_checksum')]
|
||||||
)->where('l.stage_name = ?', $stageName);
|
)->where('l.stage_name = ?', $stageName);
|
||||||
|
|
||||||
return $db->fetchOne($query);
|
return $db->fetchOne($query);
|
||||||
@ -103,8 +103,8 @@ class DeploymentStatus
|
|||||||
} else {
|
} else {
|
||||||
// check if it's in generated_config table it is undeployed
|
// check if it's in generated_config table it is undeployed
|
||||||
$generatedConfigQuery = $db->select()->from(
|
$generatedConfigQuery = $db->select()->from(
|
||||||
array('g' => 'director_generated_config'),
|
['g' => 'director_generated_config'],
|
||||||
array('checksum' => 'g.checksum')
|
['checksum' => 'g.checksum']
|
||||||
)->where('g.checksum = ?', $binaryConfigChecksums[$singleChecksum]);
|
)->where('g.checksum = ?', $binaryConfigChecksums[$singleChecksum]);
|
||||||
if ($db->fetchOne($generatedConfigQuery)) {
|
if ($db->fetchOne($generatedConfigQuery)) {
|
||||||
$status = 'undeployed';
|
$status = 'undeployed';
|
||||||
@ -131,12 +131,12 @@ class DeploymentStatus
|
|||||||
} else {
|
} else {
|
||||||
// get last deployed activity id and check if it's less than the passed one
|
// get last deployed activity id and check if it's less than the passed one
|
||||||
$generatedConfigQuery = $db->select()->from(
|
$generatedConfigQuery = $db->select()->from(
|
||||||
array('a' => 'director_activity_log'),
|
['a' => 'director_activity_log'],
|
||||||
array('id' => 'a.id')
|
['id' => 'a.id']
|
||||||
)->where('a.checksum = ?', $this->db->quoteBinary(hex2bin($singleActivityLogChecksum)));
|
)->where('a.checksum = ?', $this->db->quoteBinary(hex2bin($singleActivityLogChecksum)));
|
||||||
if ($singleActivityLogData = $db->fetchOne($generatedConfigQuery)) {
|
if ($singleActivityLogData = $db->fetchOne($generatedConfigQuery)) {
|
||||||
if ($lastDeploymentActivityLogId = $db->getLastDeploymentActivityLogId()) {
|
if ($lastDeploymentActivityLogId = $this->db->getLastDeploymentActivityLogId()) {
|
||||||
if ($singleActivityLogData->id > $lastDeploymentActivityLogId) {
|
if ((int) $singleActivityLogData > $lastDeploymentActivityLogId) {
|
||||||
$status = 'undeployed';
|
$status = 'undeployed';
|
||||||
} else {
|
} else {
|
||||||
$status = 'deployed';
|
$status = 'deployed';
|
||||||
@ -156,13 +156,10 @@ class DeploymentStatus
|
|||||||
public function getDeployedConfigs(array $binaryConfigChecksums)
|
public function getDeployedConfigs(array $binaryConfigChecksums)
|
||||||
{
|
{
|
||||||
$db = $this->db->getDbAdapter();
|
$db = $this->db->getDbAdapter();
|
||||||
$deploymentLogQuery = $db->select()->from(
|
$deploymentLogQuery = $db->select()->from(['l' => 'director_deployment_log'], [
|
||||||
array('l' => 'director_deployment_log'),
|
'checksum' => $this->db->dbHexFunc('l.config_checksum'),
|
||||||
array(
|
'deployed' => 'l.startup_succeeded'
|
||||||
'checksum' => $this->db->dbHexFunc('l.config_checksum'),
|
])->where('l.config_checksum IN (?)', $binaryConfigChecksums);
|
||||||
'deployed' => 'l.startup_succeeded'
|
|
||||||
)
|
|
||||||
)->where('l.config_checksum IN (?)', $binaryConfigChecksums);
|
|
||||||
return $db->fetchPairs($deploymentLogQuery);
|
return $db->fetchPairs($deploymentLogQuery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user