indexerror in vmbuilder when partitionfile contains 2 columns or less

Bug #784888 reported by garo
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vm-builder (Ubuntu)
Fix Released
High
Serge Hallyn
Natty
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: python-vm-builder

==================================
SRU justification:
1. Impact: using a partition file which doesn't container *optional* elements causes failure.
2. How bug addressed: the code is patched to use a proper test for the presence of the optional elements. (Existing check was simply wrong)
3. Patch: See comment number 4
4. To reproduce:
cat > partfile << EOF
root 4000
swap 1000
EOF
vmbuilder xen ubuntu --part partfile
5. Regression potential: If the patch were wrong, other bugs in the parsing of the partfile could be introduced.
==================================

In 11.04 with python-vm-builder 0.12.4+bzr464-0ubuntu1, when you have a file vmbuilder.partition with 2 lines:
root 4000
swap 1000

and you run "vmbuilder xen ubuntu --suite natty --flavour virtual --arch amd64 -o --ip 192.168.122.2 --hostname myvm --bridge virbr0 --part vmbuilder.partition --user user --name user --pass default" it will crash with this error:
Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/contrib/cli.py", line 222, in main
    self.set_disk_layout(hypervisor)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/contrib/cli.py", line 351, in set_disk_layout
    if not elements[3]:
IndexError: list index out of range

This is fixed with the patch i included

Revision history for this message
garo (nikolas) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better.

I will upload your patch (with one change - len(elements) check should be < 4, as elements[3] is the fourth option. I'll push that to oneiric, then SRU the fix to natty.

Changed in vm-builder (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Serge Hallyn (serge-hallyn)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vm-builder - 0.12.4+bzr466-0ubuntu1

---------------
vm-builder (0.12.4+bzr466-0ubuntu1) oneiric; urgency=low

  * Fix from garo: If you provide a .partition file whose lines have < 4
    elements, vmbuilder would incorrectly (since the 3d and 4th parameters
    are optional) fail. (LP: #784888)
 -- Serge Hallyn <email address hidden> Wed, 18 May 2011 18:10:20 -0500

Changed in vm-builder (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :
description: updated
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted vm-builder into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in vm-builder (Ubuntu Natty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Rolf Leggewie (r0lf) wrote :

natty has seen the end of its life and is no longer receiving any updates. Marking the natty task for this ticket as "Won't Fix".

Changed in vm-builder (Ubuntu Natty):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.