From 6680b28e2283e0467f891b14b902dc919a7d9740 Mon Sep 17 00:00:00 2001 From: Niclas Berglind Date: Thu, 11 Sep 2014 22:20:34 +0200 Subject: [PATCH] Last commit introduced new issues. Signed-off-by: Niclas Berglind --- src/Utils.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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(); -- 2.39.2