pygrub: fix attribute error when not found parser
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Dec 2009 12:20:57 +0000 (12:20 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Dec 2009 12:20:57 +0000 (12:20 +0000)
Signed-off-by: Wei Kong <weikong.cn@gmail.com>
tools/pygrub/src/pygrub

index d77fee77d1da2ec1b7db249e93a2c855ef779d3e..c2870853c2cc63afb54e36a43b37a2ff35aa67cf 100644 (file)
@@ -397,7 +397,7 @@ class Grub:
                 self.cf = parser()
                 self.cf.filename = f
                 break
-        if self.cf.filename is None:
+        if self.__dict__.get('cf', None) is None:
             raise RuntimeError, "couldn't find bootloader config file in the image provided."
         f = fs.open_file(self.cf.filename)
         buf = f.read()