]> git.datanom.net - omvzfs.git/blobdiff - gui/rpc/zfs.inc
Fix blkid not showing newly created pools plus a small typo fix.
[omvzfs.git] / 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.057154 seconds and 5 git commands to generate.