From: Niclas Berglind Date: Mon, 14 Apr 2014 18:49:00 +0000 (+0200) Subject: Added method to promote a cloned Dataset. X-Git-Url: http://git.datanom.net/omvzfs.git/commitdiff_plain/cce9607beaa7189bd6d98603905cae381ec95ebe Added method to promote a cloned Dataset. Signed-off-by: Niclas Berglind --- diff --git a/src/Dataset.php b/src/Dataset.php index 253909c..d60fd06 100644 --- a/src/Dataset.php +++ b/src/Dataset.php @@ -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).