]> git.datanom.net - omvzfs.git/commitdiff
Added inherit method to Dataset
authorNiclas Berglind <nb@kjam.se>
Tue, 4 Mar 2014 18:44:18 +0000 (19:44 +0100)
committerMichael Rasmussen <mir@datanom.net>
Tue, 4 Mar 2014 21:52:38 +0000 (22:52 +0100)
Signed-off-by: Niclas Berglind <nb@kjam.se>
src/Dataset.php

index 673d011b00f1ca9568a2f3b8110d45c8de8254b3..2ba1bede28e5f4af83fd2077eeb1c2632e243d38 100644 (file)
@@ -121,6 +121,7 @@ class OMVModuleZFSDataset {
        /**
         * Get all Dataset properties from commandline and update object properties attribute
         *
+        * @return void
         * @throws OMVModuleZFSException
         * @access private
         */ 
@@ -141,6 +142,7 @@ class OMVModuleZFSDataset {
         * Get single Datset property from commandline and update object property attribute
         *
         * @param string $property Name of the property to update
+        * @return void
         * @throws OMVModuleZFSException
         * @access private
         */
@@ -157,6 +159,7 @@ class OMVModuleZFSDataset {
        /**
         * Destroy the Dataset.
         *
+        * @return void
         * @throws OMVModuleZFSException
         * @access public
         */
@@ -172,6 +175,7 @@ class OMVModuleZFSDataset {
         * Renames a Dataset
         *
         * @param string $newname New name of the Dataset
+        * @return void
         * @throws OMVModuleZFSException
         * @access public
         */
@@ -184,6 +188,24 @@ class OMVModuleZFSDataset {
                $this->name = $newname;
        }
 
+       /**
+        * Clears a previously set proporty and specifies that it should be
+        * inherited from it's parent.
+        *
+        * @param string $property Name of the property to inherit.
+        * @return void
+        * @throws OMVModuleZFSException
+        * @access public
+        */
+       public function inherit($property) {
+               $cmd = "zfs inherit " . $property . " " . $this->name . " 2>&1";
+               OMVUtil::exec($cmd,$out,$res);
+               if ($res) {
+                       throw new OMVModuleZFSException(implode("\n", $out));
+               }
+               $this->updateProperty($property);
+       }
+
 }
 
 ?>
This page took 0.033114 seconds and 5 git commands to generate.