Add exception for missing kvm-img and qemu-img

Bug #1324952 reported by gdm85
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VMBuilder
New
Undecided
Unassigned

Bug Description

Trying to build on a system without kvm-img and qemu-img, the following happens:

2014-05-30 15:49:59,731 INFO : Mounting target filesystems
2014-05-30 15:49:59,732 INFO : Creating disk image: "/tmp/tmp88bqMh" of size: 11264MB
2014-05-30 15:49:59,734 INFO : Cleaning up
2014-05-30 15:49:59,734 ERROR : Couldn't find the program 'None' on your system
Traceback (most recent call last):
  File "/usr/local/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/local/lib/python2.7/dist-packages/VMBuilder/contrib/cli.py", line 228, in main
    hypervisor.install_os()
  File "/usr/local/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 65, in install_os
    self.call_hooks('mount_partitions', self.chroot_dir)
  File "/usr/local/lib/python2.7/dist-packages/VMBuilder/distro.py", line 67, in call_hooks
    call_hooks(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/VMBuilder/util.py", line 170, in call_hooks
    getattr(context, func)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 88, in mount_partitions
    disk.create()
  File "/usr/local/lib/python2.7/dist-packages/VMBuilder/disk.py", line 102, in create
    run_cmd(qemu_img_path(), 'create', '-f', 'raw', self.filename, '%dM' % self.size)
  File "/usr/local/lib/python2.7/dist-packages/VMBuilder/util.py", line 100, in run_cmd
    raise VMBuilderUserError, "Couldn't find the program '%s' on your system" % (argv[0])
VMBuilder.exception.VMBuilderUserError: Couldn't find the program 'None' on your system

I propose merging the small patch in attachment, perhaps with correct exception type.

Revision history for this message
gdm85 (gdm85) wrote :
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.