summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorSimon Rettberg2020-02-26 10:21:57 +0100
committerSimon Rettberg2020-02-26 10:21:57 +0100
commitd16d25a28b41c9abe3ec8f9a62b0f316a7606823 (patch)
tree574ca56498eafad6c15d91583e3aab71445b6d60 /inc
parent[dnbd3] Remove unused code (diff)
downloadslx-admin-d16d25a28b41c9abe3ec8f9a62b0f316a7606823.tar.gz
slx-admin-d16d25a28b41c9abe3ec8f9a62b0f316a7606823.tar.xz
slx-admin-d16d25a28b41c9abe3ec8f9a62b0f316a7606823.zip
[dnbd3] Run mount script when toggling dnbd3 usage
Pass the new "if local only" option, so the script only acutally runs if internal storage is being used, since that takes care of properly enabling or disabling the NFS server.
Diffstat (limited to 'inc')
-rw-r--r--inc/trigger.inc.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php
index ecfa6017..8ed098fc 100644
--- a/inc/trigger.inc.php
+++ b/inc/trigger.inc.php
@@ -128,9 +128,10 @@ class Trigger
* Mount the VM store into the server.
*
* @param array $vmstore VM Store configuration to use. If false, read from properties
+ * @param bool $ifLocalOnly Only execute task if the storage type is local (used for DNBD3)
* @return array|false task status of mount procedure, or false on error
*/
- public static function mount($vmstore = false)
+ public static function mount($vmstore = false, $ifLocalOnly = false)
{
if ($vmstore === false) {
$vmstore = Property::getVmStoreConfig();
@@ -152,6 +153,9 @@ class Trigger
$opts = null;
$addr = 'null';
}
+ // Bail out if storage is not local, and we only want to run it in that case
+ if ($ifLocalOnly && $addr !== 'null')
+ return false;
if (isset($vmstore[$opts])) {
$opts = $vmstore[$opts];
}else {