summaryrefslogtreecommitdiffstats
path: root/inc/trigger.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-16 18:33:16 +0100
committerSimon Rettberg2017-12-16 18:33:16 +0100
commitcd55ead3e2810e209b726faca12fa749f6875d0f (patch)
tree94b2f29b023e8a0c5100e1d06c974c3c04f890fd /inc/trigger.inc.php
parentMerge branch 'permission-manager' of openslx.org:openslx-ng/slx-admin into pe... (diff)
downloadslx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.gz
slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.xz
slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.zip
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.
Diffstat (limited to 'inc/trigger.inc.php')
-rw-r--r--inc/trigger.inc.php19
1 files changed, 15 insertions, 4 deletions
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;
}