← Back to team overview

vmbuilder team mailing list archive

[Merge] lp:~barry/vmbuilder/bug-612082 into lp:vmbuilder

 

Barry Warsaw has proposed merging lp:~barry/vmbuilder/bug-612082 into lp:vmbuilder.

Requested reviews:
  VMBuilder (vmbuilder)
Related bugs:
  Bug #612082 in VMBuilder: "optparser attribute missing in cli.py (warning-message-printing fail when --part is given a nonexistent file)"
  https://bugs.launchpad.net/vmbuilder/+bug/612082

For more details, see:
https://code.launchpad.net/~barry/vmbuilder/bug-612082/+merge/80615

Fixes bug 612082; printing warning message fails when --part is given a
nonexistent file.  Patch given by Daniel Holbert; ported to trunk by Barry
Warsaw.
-- 
https://code.launchpad.net/~barry/vmbuilder/bug-612082/+merge/80615
Your team VMBuilder is requested to review the proposed merge of lp:~barry/vmbuilder/bug-612082 into lp:vmbuilder.
=== modified file 'VMBuilder/contrib/cli.py'
--- VMBuilder/contrib/cli.py	2011-05-18 23:07:40 +0000
+++ VMBuilder/contrib/cli.py	2011-10-27 20:03:24 +0000
@@ -219,7 +219,7 @@
                 print 'Chroot can be found in %s' % distro.chroot_dir
                 sys.exit(0)
 
-            self.set_disk_layout(hypervisor)
+            self.set_disk_layout(optparser, hypervisor)
             hypervisor.install_os()
 
             os.mkdir(destdir)
@@ -301,7 +301,7 @@
         elif opt_str == '--quiet':
             VMBuilder.set_console_loglevel(logging.CRITICAL)
 
-    def set_disk_layout(self, hypervisor):
+    def set_disk_layout(self, optparser, hypervisor):
         default_filesystem = hypervisor.distro.preferred_filesystem()
         if not self.options.part:
             rootsize = parse_size(self.options.rootsize)
@@ -380,8 +380,8 @@
                                                       filename=tmpfile,
                                                       mntpnt=elements[0])
                 except IOError, (errno, strerror):
-                    self.optparser.error("%s parsing --part option: %s" %
-                                                           (errno, strerror))
+                    optparser.error("%s parsing --part option: %s" %
+                                    (errno, strerror))
             else:
                 try:
                     curdisk = list()
@@ -403,8 +403,8 @@
                     self.do_disk(hypervisor, curdisk, size, disk_idx)
 
                 except IOError, (errno, strerror):
-                    hypervisor.optparser.error("%s parsing --part option: %s" %
-                                                              (errno, strerror))
+                    optparser.error("%s parsing --part option: %s" %
+                                    (errno, strerror))
 
     def do_disk(self, hypervisor, curdisk, size, disk_idx):
         default_filesystem = hypervisor.distro.preferred_filesystem()