]> git.datanom.net - omvzfs.git/blobdiff - src/Utils.php
Last commit introduced new issues.
[omvzfs.git] / src / Utils.php
index 527d0f34890fea6258e446c289dd44e682629148..8dba1fe134a6303c61cf26ddaaa2b0da7736fdbb 100644 (file)
@@ -45,9 +45,17 @@ class OMVModuleZFSUtil {
                foreach($out as $name) {
                        $pooluuid = OMVModuleZFSUtil::getUUIDbyName($name);
                        if (isset($pooluuid)) {
-                               $xpath = "//system/fstab/mntent[fsname=" . $pooluuid . "]";
+                               $pooluuid = "UUID=" . $pooluuid;
+                               $xpath = "//system/fstab/mntent";
                                $object = $xmlConfig->get($xpath);
-                               if(is_null($object)) {
+                               $uuidexists = false;
+                               foreach ($object as $obj) {
+                                       if (strcmp($pooluuid, $obj['fsname']) === 0) {
+                                               $uuidexists = true;
+                                               break;
+                                       }
+                               }
+                               if (!$uuidexists) {
                                        $uuid = OMVUtil::uuid();
                                        $ds = new OMVModuleZFSDataset($name);
                                        $dir = $ds->getMountPoint();
This page took 0.117425 seconds and 5 git commands to generate.