diff options
author | Matthew Booth <mbooth@redhat.com> | 2010-04-21 15:39:48 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-04-21 16:51:20 +0100 |
commit | 2b43970c8c97f24b1f45c040c6963d30661fa514 (patch) | |
tree | 5c3d3d119098648fb2a3795f5280a76e5712cb78 /perl/lib | |
parent | 216557b1ebc013701e7474720bc1280f43e51bb1 (diff) | |
download | libguestfs-2b43970c8c97f24b1f45c040c6963d30661fa514.tar.gz libguestfs-2b43970c8c97f24b1f45c040c6963d30661fa514.tar.xz libguestfs-2b43970c8c97f24b1f45c040c6963d30661fa514.zip |
Don't die during inspection if initrd doesn't exist
This fixes a problem where inspection would die if grub.conf referenced a
non-existent initrd. Just return an empty initrd instead.
Diffstat (limited to 'perl/lib')
-rw-r--r-- | perl/lib/Sys/Guestfs/Lib.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index 5428b104..b5b3906c 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -1825,7 +1825,7 @@ sub _inspect_initrd # Disregard old-style compressed ext2 files and only work with real # compressed cpio files, since cpio takes ages to (fail to) process anything # else. - if ($g->file ($path) =~ /cpio/) { + if ($g->exists($path) && $g->file($path) =~ /cpio/) { eval { @modules = $g->initrd_list ($path); }; |