]> git.datanom.net - omvzfs.git/blobdiff - src/Zpool.php
Made it possible to force create Vdevs.
[omvzfs.git] / src / Zpool.php
index 6c06e3d97a3429f33b6d468ed06b114b895f94dd..56ec8c64d4426e98d239710d5e3d8b70448c24d5 100644 (file)
@@ -192,11 +192,11 @@ class OMVModuleZFSZpool extends OMVModuleAbstract {
      * @throws OMVModuleZFSException
      * @access public
      */
-    public function addVdev(array $vdevs) {
-               $cmd = "zpool add " . $this->name . " " . $this->getCommandString($vdevs);
+    public function addVdev(array $vdevs, $opts= "") {
+               $cmd = "zpool add " . $this->name . " " . $opts . $this->getCommandString($vdevs) . " 2>&1";
                OMVUtil::exec($cmd, $output, $result);
                if ($result)
-                       throw new OMVModuleZFSException($output);
+                       throw new OMVModuleZFSException(implode("\n", $output));
                else
                        $this->vdevs = array_merge($this->vdevs, $vdevs);
                $this->size = $this->getAttribute("size");
@@ -636,7 +636,7 @@ class OMVModuleZFSZpool extends OMVModuleAbstract {
         * @param string $attribute
         * @return string value
         */
-       private function getAttribute($attribute) {
+       public function getAttribute($attribute) {
                $cmd = "zpool list -H -o $attribute {$this->name}";
                OMVUtil::exec($cmd, $output, $result);
                if ($result) {
This page took 0.029648 seconds and 5 git commands to generate.