X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/c08a9e590d1ca6fd5d3539f1a50832dc3a1a60ef..HEAD:/gui/rpc/zfs.inc diff --git a/gui/rpc/zfs.inc b/gui/rpc/zfs.inc index 881372a..22011e4 100644 --- a/gui/rpc/zfs.inc +++ b/gui/rpc/zfs.inc @@ -79,14 +79,21 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { } $disks = preg_split("/[,;]/", $params['devices']); + foreach ($disks as $disk) { + OMVModuleZFSUtil::setGPTLabel($disk); + } //Use /dev/disk/by-path as suggested in ZoL FAQ. if ($params['diskpath']) { - if (file_exists("/dev/disk/by-path/")) { - $tmp_disks = array(); - foreach ($disks as $disk) { - $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk); + try { + if (file_exists("/dev/disk/by-path/")) { + $tmp_disks = array(); + foreach ($disks as $disk) { + $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk); + } + $disks = $tmp_disks; } - $disks = $tmp_disks; + } catch (OMVModuleZFSException $e) { + //Do nothing if an excpetion is thrown } } @@ -579,14 +586,21 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $opts .= "-f "; } $disks = preg_split("/[,;]/", $params['devices']); + foreach ($disks as $disk) { + OMVModuleZFSUtil::setGPTLabel($disk); + } //Use /dev/disk/by-path as suggested in ZoL FAQ. if ($params['diskpath']) { - if (file_exists("/dev/disk/by-path/")) { - $tmp_disks = array(); - foreach ($disks as $disk) { - $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk); + try { + if (file_exists("/dev/disk/by-path/")) { + $tmp_disks = array(); + foreach ($disks as $disk) { + $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk); + } + $disks = $tmp_disks; } - $disks = $tmp_disks; + } catch (OMVModuleZFSException $e) { + //Do nothing if an exception is thrown } } $vdev[] = new OMVModuleZFSVdev($params['name'], $pooltype, $disks);