[pve-devel] [PATCH ha-manager v2 3/7] Sim/Hardware: check if testdir exists
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Jun 15 17:58:59 CEST 2016
avoids stranges error like "could not open dir/group.tmp.PID"
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
src/PVE/HA/Sim/Hardware.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index a212671..be1037d 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -285,6 +285,9 @@ sub new {
die "missing testdir" if !$testdir;
+ die "testdir '$testdir' does not exist or is not a directory!\n"
+ if !-d $testdir;
+
my $class = ref($this) || $this;
my $self = bless {}, $class;
--
2.1.4
More information about the pve-devel
mailing list