]> git.datanom.net - omvzfs.git/commitdiff
Fix blkid not showing newly created pools plus a small typo fix.
authorNiclas Berglind <nb@kjam.se>
Thu, 4 Sep 2014 19:49:00 +0000 (21:49 +0200)
committerMichael Rasmussen <mir@datanom.net>
Thu, 4 Sep 2014 20:47:59 +0000 (22:47 +0200)
Signed-off-by: Niclas Berglind <nb@kjam.se>
gui/rpc/zfs.inc

index f0b64f6de2ca3d3a9550aa707c51ce71eb8a54f5..b110ebe24e6c5266f81bda4fb0585d3e5e3f8c77 100644 (file)
@@ -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;
This page took 0.03227 seconds and 5 git commands to generate.