X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/e078be88378149c73ba149af46cf6d595866c5c5..97e4887b3864cc11f131c51eb337e7bb4c025e27:/src/Dataset.php diff --git a/src/Dataset.php b/src/Dataset.php index 253909c..65cca31 100644 --- a/src/Dataset.php +++ b/src/Dataset.php @@ -301,7 +301,7 @@ class OMVModuleZFSDataset { */ public function isClone() { $origin = $this->getProperty("origin"); - if (strlen($origin) > 0) { + if (strlen($origin["value"]) > 0) { return true; } else { return false; @@ -316,12 +316,26 @@ class OMVModuleZFSDataset { */ public function getOrigin() { if ($this->isClone()) { - return $this->getProperty("origin"); + $origin = $this->getProperty("origin"); + return $origin['value']; } else { return ""; } } + /** + * 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).