From 57667eb1122f91698c785b05be94af26c00708bb Mon Sep 17 00:00:00 2001 From: Niclas Berglind Date: Thu, 4 Sep 2014 21:49:00 +0200 Subject: [PATCH] Fix blkid not showing newly created pools plus a small typo fix. Signed-off-by: Niclas Berglind --- gui/rpc/zfs.inc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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; -- 2.39.2