From 571b6f2638572c6e4cc231c6e70f590014bbdd5d Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 17 Oct 2016 10:29:12 +0200 Subject: [PATCH] add default rotational value because if the file does not exist, we have an perl error for comparing an uninitialized value Signed-off-by: Dominik Csapak --- PVE/Diskmanage.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm index c8706b7..938d6a4 100644 --- a/PVE/Diskmanage.pm +++ b/PVE/Diskmanage.pm @@ -282,7 +282,7 @@ sub get_sysdir_info { $data->{size} = $size * 512; # dir/queue/rotational should be 1 for hdd, 0 for ssd - $data->{rotational} = file_read_firstline("$sysdir/queue/rotational"); + $data->{rotational} = file_read_firstline("$sysdir/queue/rotational") // -1; $data->{vendor} = file_read_firstline("$sysdir/device/vendor") || 'unknown'; $data->{model} = file_read_firstline("$sysdir/device/model") || 'unknown';