From: Niclas Berglind Date: Thu, 11 Sep 2014 20:20:34 +0000 (+0200) Subject: Last commit introduced new issues. X-Git-Url: http://git.datanom.net/omvzfs.git/commitdiff_plain/6680b28e2283e0467f891b14b902dc919a7d9740 Last commit introduced new issues. Signed-off-by: Niclas Berglind --- diff --git a/src/Utils.php b/src/Utils.php index 978901e..8dba1fe 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -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();