just calling install_extlinux in the except clause might be cleaner.

diff --git a/vmdebootstrap b/vmdebootstrap
index 126475f..e7b5f16 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -487,10 +487,10 @@ class VmDebootstrap(cliapp.Application):
             self.runcmd(['chroot', rootdir, 'grub-install', install_dev])
         except cliapp.AppException as e:
             self.message("Failed. Is grub2-common installed? Using extlinux.")
+            self.install_extlinux(rootdev, rootdir)
         self.runcmd(['umount', os.path.join(rootdir, 'sys')])
         self.runcmd(['umount', os.path.join(rootdir, 'proc')])
         self.runcmd(['umount', os.path.join(rootdir, 'dev')])
-        self.install_extlinux(rootdev, rootdir)
 
     def install_extlinux(self, rootdev, rootdir):
         if not os.path.exists("/usr/bin/extlinux"):

Reply via email to