Handle case where there are no disks

This commit is contained in:
Jamie Cameron
2011-12-09 10:23:50 -08:00
parent d819da6a30
commit c692fdb097

View File

@@ -193,6 +193,7 @@ if (open(PARTS, "/proc/partitions")) {
@devs = sort { ($b =~ /\/hd[a-z]+$/ ? 1 : 0) <=>
($a =~ /\/hd[a-z]+$/ ? 1 : 0) } @devs;
}
return ( ) if (!@devs); # No disks, ie on Xen
# Skip cd-rom drive, identified from symlink. Don't do this if we can identify
# cds by their media type though