indexerror in vmbuilder when partitionfile contains 2 columns or less
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+
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/
cli.main()
File "/usr/lib/
self.
File "/usr/lib/
if not elements[3]:
IndexError: list index out of range
This is fixed with the patch i included
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.