From cd55ead3e2810e209b726faca12fa749f6875d0f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sat, 16 Dec 2017 18:33:16 +0100 Subject: Fix A LOT of type problems, logic flaws, uninitialized variables etc. Most of them were found by phpstorm, so I put in some time and went through the list, fixing quite a bunch of them. --- inc/trigger.inc.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'inc/trigger.inc.php') diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php index db4a2148..2af73872 100644 --- a/inc/trigger.inc.php +++ b/inc/trigger.inc.php @@ -111,7 +111,7 @@ class Trigger * Mount the VM store into the server. * * @param array $vmstore VM Store configuration to use. If false, read from properties - * @return array task status of mount procedure, or false on error + * @return array|false task status of mount procedure, or false on error */ public static function mount($vmstore = false) { @@ -125,12 +125,13 @@ class Trigger } else { $storetype = 'unknown'; } - if ($storetype === 'nfs') + if ($storetype === 'nfs') { $addr = $vmstore['nfsaddr']; - if ($storetype === 'cifs') + } elseif ($storetype === 'cifs') { $addr = $vmstore['cifsaddr']; - if ($storetype === 'internal') + } else { $addr = 'null'; + } return Taskmanager::submit('MountVmStore', array( 'address' => $addr, 'type' => 'images', @@ -175,6 +176,16 @@ class Trigger $taskids['dmsdid'] = $task['id']; $parent = $task['id']; } + $task = Taskmanager::submit('Systemctl', array( + 'operation' => $action, + 'service' => 'dnbd3-server', + 'parentTask' => $parent, + 'failOnParentFail' => false + )); + if (isset($task['id'])) { + $taskids['dnbd3id'] = $task['id']; + $parent = $task['id']; + } return $parent; } -- cgit v1.2.3-55-g7522