]> git.datanom.net - omvzfs.git/blobdiff - src/Dataset.php
Minor change to clarify shared folder creation.
[omvzfs.git] / src / Dataset.php
index 253909c4d6f06694ce359e4da729be32723c44f9..65cca318d0af348f3eedb45b4458e4d84355ad1a 100644 (file)
@@ -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).
This page took 0.029237 seconds and 5 git commands to generate.