X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/a50e3caf1d538eb4bb0cd5eb8f634cb18e0065ab..e419cf47cc59a0f8ea6b62a66138ea4336046dcb:/src/Snapshot.php diff --git a/src/Snapshot.php b/src/Snapshot.php index ef90283..afd189c 100644 --- a/src/Snapshot.php +++ b/src/Snapshot.php @@ -40,14 +40,12 @@ class OMVModuleZFSSnapshot { */ public function __construct($name) { $this->name = $name; - $qname = preg_quote($name, '/'); - $cmd = "zfs list -H -t snapshot 2>&1"; - $this->exec($cmd, $out, $res); - foreach ($out as $line) { - if (preg_match('/^' . $qname . '\t.*$/', $line)) { - $this->updateAllProperties(); - continue; - } + $cmd = "zfs list -H -t snapshot " .$name . " 2>&1"; + try { + $this->exec($cmd, $out, $res); + $this->updateAllProperties(); + } + catch (OMVModuleZFSException $e) { } }