Comment 24 for bug 562189

Revision history for this message
Richard C (richard-c) wrote :

For the issue I reported above, I believe this is a bug. There are two checks for pre-existing VMs, and they differ:
/usr/lib/python2.7/dist-packages/VMBuilder/plugins/libvirt/__init__.py
line 54: if hostname in self.all_domains() and not self.context.overwrite:
line 80: if hostname in self.all_domains() and not self.vm.overwrite:

Changing line 80 to match line 54 prevents this error.

Line 80 throws an error when run:
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 227, in main
    hypervisor.finalise(destdir)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 78, in finalise
    self.call_hooks('deploy', destdir)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/distro.py", line 67, in call_hooks
    call_hooks(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/util.py", line 158, in call_hooks
    getattr(plugin, func, log_no_such_method)(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/plugins/libvirt/__init__.py", line 80, in deploy
    if hostname in self.all_domains() and not self.vm.overwrite:
AttributeError: 'Libvirt' object has no attribute 'vm'