]> git.datanom.net - omvzfs.git/commitdiff
Added method to promote a cloned Dataset.
authorNiclas Berglind <nb@kjam.se>
Mon, 14 Apr 2014 18:49:00 +0000 (20:49 +0200)
committerMichael Rasmussen <mir@datanom.net>
Thu, 17 Apr 2014 23:10:54 +0000 (01:10 +0200)
Signed-off-by: Niclas Berglind <nb@kjam.se>
src/Dataset.php

index 253909c4d6f06694ce359e4da729be32723c44f9..d60fd069553dfdf3afde121fb867344d3d14bc91 100644 (file)
@@ -322,6 +322,19 @@ class OMVModuleZFSDataset {
                }
        }
 
+       /**
+       * Promotes the Dataset if it's a clone.
+       *
+       * @return void
+       * @access public
+       */
+       public function promote() {
+               if ($this->isClone()) {
+                       $cmd = "zfs promote " . $this->name . " 2>&1";
+                       $this->exec($cmd,$out,$res);
+               }
+       }
+
        /**
         * Helper function to execute a command and throw an exception on error
         * (requires stderr redirected to stdout for proper exception message).
This page took 0.031673 seconds and 5 git commands to generate.