From 2777aa0105ab8da8c267156a076349651205c1cd Mon Sep 17 00:00:00 2001 From: Niclas Berglind Date: Sat, 22 Mar 2014 14:14:37 +0100 Subject: [PATCH] Fixed some commands in Zvol class. Signed-off-by: Niclas Berglind --- src/Zvol.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Zvol.php b/src/Zvol.php index 9be6f5e..47701dc 100644 --- a/src/Zvol.php +++ b/src/Zvol.php @@ -50,7 +50,7 @@ class OMVModuleZFSZvol { public function __construct($name) { $this->name = $name; $qname = preg_quote($name, '/'); - $cmd = "zfs list -H -t volume"; + $cmd = "zfs list -H -t volume 2>&1"; $this->exec($cmd, $out, $res); foreach ($out as $line) { if (preg_match('/^' . $qname . '\t.*$/', $line)) { @@ -113,7 +113,7 @@ class OMVModuleZFSZvol { */ public function setProperties($properties) { foreach ($properties as $newpropertyk => $newpropertyv) { - $cmd = "zfs set " . $newpropertyk . "=" . $newpropertyv . " " . $this->name; + $cmd = "zfs set " . $newpropertyk . "=" . $newpropertyv . " " . $this->name . " 2>&1"; $this->exec($cmd,$out,$res); $this->updateProperty($newpropertyk); } @@ -126,7 +126,7 @@ class OMVModuleZFSZvol { * @access private */ private function updateAllProperties() { - $cmd = "zfs get -H all " . $this->name; + $cmd = "zfs get -H all " . $this->name . " 2>&1"; $this->exec($cmd,$out,$res); unset($this->properties); foreach ($out as $line) { @@ -143,7 +143,7 @@ class OMVModuleZFSZvol { * @access private */ private function updateProperty($property) { - $cmd = "zfs get -H " . $property . " " . $this->name; + $cmd = "zfs get -H " . $property . " " . $this->name . " 2>&1"; $this->exec($cmd,$out,$res); $tmpary = preg_split('/\t+/', $out[0]); $this->properties["$tmpary[1]"] = array("value" => $tmpary[2], "source" => $tmpary[3]); @@ -177,7 +177,7 @@ class OMVModuleZFSZvol { * @access public */ public function destroy() { - $cmd = "zfs destroy " . $this->name; + $cmd = "zfs destroy " . $this->name . " 2>&1"; $this->exec($cmd,$out,$res); } -- 2.39.2