From cce9607beaa7189bd6d98603905cae381ec95ebe Mon Sep 17 00:00:00 2001 From: Niclas Berglind Date: Mon, 14 Apr 2014 20:49:00 +0200 Subject: [PATCH] Added method to promote a cloned Dataset. Signed-off-by: Niclas Berglind --- src/Dataset.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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). -- 2.39.2