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 <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
865bdbd917
commit
571b6f2638
@ -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';
|
||||
|
||||
Reference in New Issue
Block a user