* @throws OMVModuleZFSException
* @access public
*/
- public function addVdev(array $vdevs) {
- $cmd = "zpool add " . $this->name . " " . $this->getCommandString($vdevs);
+ public function addVdev(array $vdevs, $opts= "") {
+ $cmd = "zpool add " . $this->name . " " . $opts . $this->getCommandString($vdevs) . " 2>&1";
OMVUtil::exec($cmd, $output, $result);
if ($result)
- throw new OMVModuleZFSException($output);
+ throw new OMVModuleZFSException(implode("\n", $output));
else
$this->vdevs = array_merge($this->vdevs, $vdevs);
$this->size = $this->getAttribute("size");
* @param string $attribute
* @return string value
*/
- private function getAttribute($attribute) {
+ public function getAttribute($attribute) {
$cmd = "zpool list -H -o $attribute {$this->name}";
OMVUtil::exec($cmd, $output, $result);
if ($result) {
$dev = null;
}
$type = $match[1];
- } else if (preg_match("/^\s*([\w\d-]+)\s+/", $line, $match)) {
+ } else if (preg_match("/^\s*([\w\d-a-z0-9\:\.\-]+)\s+/", $line, $match)) {
if ($dev)
$dev .= " $match[1]";
else