X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/8b5e924e60573b86c0007f5975f4fae07176c6a8..3ed7a24053f0123d8d4e18ef313d83d23181de00:/gui/rpc/zfs.inc diff --git a/gui/rpc/zfs.inc b/gui/rpc/zfs.inc index 881372a..9ab61a2 100644 --- a/gui/rpc/zfs.inc +++ b/gui/rpc/zfs.inc @@ -81,12 +81,16 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $disks = preg_split("/[,;]/", $params['devices']); //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 } } @@ -581,12 +585,16 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $disks = preg_split("/[,;]/", $params['devices']); //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);