]> git.datanom.net - omvzfs.git/blobdiff - src/Utils.php
further integration with omv
[omvzfs.git] / src / Utils.php
index 978901e18d44d118827db44896976e46daf7e8a0..f00b6d1a01b509ce8eb4263f8603a61913feaf0f 100644 (file)
@@ -46,9 +46,16 @@ class OMVModuleZFSUtil {
                        $pooluuid = OMVModuleZFSUtil::getUUIDbyName($name);
                        if (isset($pooluuid)) {
                                $pooluuid = "UUID=" . $pooluuid;
-                               $xpath = "//system/fstab/mntent[fsname=" . $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();
@@ -137,7 +144,7 @@ class OMVModuleZFSUtil {
                                        'parentid'=>$prefix . $root . "/" . $result[1],
                                        'name'=>$result[2],
                                        'type'=>ucfirst($type),
-                                       'icon'=>"images/zfs_disk.png",
+                                       'icon'=>"images/save.png",
                                        'path'=>$path,
                                        'expanded'=>$expanded);
                                array_push($objects,$tmp);
This page took 0.047665 seconds and 5 git commands to generate.