From: Niclas Berglind Date: Thu, 4 Sep 2014 19:49:00 +0000 (+0200) Subject: Fix blkid not showing newly created pools plus a small typo fix. X-Git-Url: http://git.datanom.net/omvzfs.git/commitdiff_plain/57667eb1122f91698c785b05be94af26c00708bb Fix blkid not showing newly created pools plus a small typo fix. Signed-off-by: Niclas Berglind --- diff --git a/gui/rpc/zfs.inc b/gui/rpc/zfs.inc index f0b64f6..b110ebe 100644 --- a/gui/rpc/zfs.inc +++ b/gui/rpc/zfs.inc @@ -56,6 +56,9 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $disks = preg_split("/[,;]/", $params['devices']); $vdev = new OMVModuleZFSVdev($params['name'], $pooltype, $disks); $pool = new OMVModuleZFSZpool($vdev); + //Ugly fix to solve the problem of blkid not displaying info on newly created pools + $pool->export(); + $pool->import($pool->getName()); } public function getObjectTree($params, $context) { @@ -80,23 +83,19 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { public function addObject($params, $context) { $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); switch ($params['type']) { - case "Filesystem": + case "filesystem": $name = $params['path'] . "/" . $params['name']; $tmp = new OMVModuleZFSDataset($name); break; - case "Snapshot": + case "snapshot": $name = $params['path'] . "@" . $params['name']; $tmp = new OMVModuleZFSSnapshot($name); break; - case "Volume": + case "volume": $name = $params['path'] . "/" . $params['name']; $tmp = new OMVModuleZFSZvol($name); $tmp->create($params['size']); break; - case "Pool": - $name = $params['path'] . "/" . $params['name']; - $tmp = new OMVModuleZFSZpool($name); - break; default: throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); break;