TypeError: deploy() takes exactly 1 argument (2 given)

Bug #677378 reported by Dario Bertini
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
VMBuilder
New
Undecided
Unassigned
vm-builder (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

sudo vmbuilder vbox ubuntu

2010-11-19 05:48:36,286 INFO : Calling hook: preflight_check
2010-11-19 05:48:36,289 INFO : Calling hook: set_defaults
2010-11-19 05:48:36,290 INFO : Calling hook: bootstrap
2010-11-19 05:56:51,392 INFO : Calling hook: configure_os
2010-11-19 05:58:12,822 INFO :
2010-11-19 05:58:12,822 INFO : Current default time zone: 'Etc/UTC'
2010-11-19 05:58:12,827 INFO : Local time is now: Fri Nov 19 04:58:12 UTC 2010.
2010-11-19 05:58:12,827 INFO : Universal Time is now: Fri Nov 19 04:58:12 UTC 2010.
2010-11-19 05:58:12,827 INFO :
Extracting templates from packages: 100%
2010-11-19 06:02:36,195 INFO :
2010-11-19 06:02:36,195 INFO : Current default time zone: 'Etc/UTC'
2010-11-19 06:02:36,200 INFO : Local time is now: Fri Nov 19 05:02:36 UTC 2010.
2010-11-19 06:02:36,201 INFO : Universal Time is now: Fri Nov 19 05:02:36 UTC 2010.
2010-11-19 06:02:36,201 INFO : Run 'dpkg-reconfigure tzdata' if you wish to change it.
2010-11-19 06:02:36,201 INFO :
2010-11-19 06:02:47,611 INFO : start: Job is already running: network-interface-security
2010-11-19 06:02:53,992 INFO : Calling hook: post_install
2010-11-19 06:02:53,993 INFO : Calling hook: preflight_check
2010-11-19 06:02:53,994 INFO : Calling hook: configure_networking
2010-11-19 06:02:54,019 INFO : Calling hook: configure_mounting
2010-11-19 06:02:54,035 INFO : Calling hook: mount_partitions
2010-11-19 06:02:54,036 INFO : Mounting target filesystems
2010-11-19 06:02:54,036 INFO : Creating disk image: "/tmp/tmpPx9GHW" of size: 5120MB
2010-11-19 06:02:54,058 INFO : Adding partition table to disk image: /tmp/tmpPx9GHW
2010-11-19 06:02:54,149 INFO : Adding type 4 partition to disk image: /tmp/tmpPx9GHW
2010-11-19 06:02:54,178 INFO : Adding type 3 partition to disk image: /tmp/tmpPx9GHW
2010-11-19 06:02:54,185 INFO : [0] ../../libparted/filesys.c:148 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated
2010-11-19 06:02:54,201 INFO : Creating loop devices corresponding to the created partitions
2010-11-19 06:02:54,214 INFO : Creating file systems
2010-11-19 06:02:54,229 INFO : mke2fs 1.41.12 (17-May-2010)
2010-11-19 06:02:58,072 INFO : mkswap: /dev/mapper/loop0p2: warning: don't erase bootbits sectors
2010-11-19 06:02:58,072 INFO : on whole disk. Use -f to force.
2010-11-19 06:04:07,727 INFO : Calling hook: install_bootloader
2010-11-19 06:05:02,374 INFO : Searching for GRUB installation directory ... found: /boot/grub
2010-11-19 06:05:02,533 INFO : Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
2010-11-19 06:05:02,539 INFO : Searching for GRUB installation directory ... found: /boot/grub
2010-11-19 06:05:02,545 INFO : Testing for an existing GRUB menu.lst file ...
2010-11-19 06:05:02,545 INFO :
2010-11-19 06:05:02,546 INFO : Could not find /boot/grub/menu.lst file.
2010-11-19 06:05:02,546 INFO : Generating /boot/grub/menu.lst
2010-11-19 06:05:02,653 INFO : Searching for splash image ... none found, skipping ...
2010-11-19 06:05:02,848 INFO : grep: /boot/config*: No such file or directory
2010-11-19 06:05:02,940 INFO : Updating /boot/grub/menu.lst ... done
2010-11-19 06:05:02,940 INFO :
2010-11-19 06:05:03,190 INFO : Searching for GRUB installation directory ... found: /boot/grub
2010-11-19 06:05:03,241 INFO : Searching for default file ... found: /boot/grub/default
2010-11-19 06:05:03,246 INFO : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
2010-11-19 06:05:03,398 INFO : Searching for splash image ... none found, skipping ...
2010-11-19 06:05:03,432 INFO : grep: /boot/config*: No such file or directory
2010-11-19 06:05:03,528 INFO : Updating /boot/grub/menu.lst ... done
2010-11-19 06:05:03,528 INFO :
2010-11-19 06:05:03,606 INFO : Searching for GRUB installation directory ... found: /boot/grub
2010-11-19 06:05:03,627 INFO : Calling hook: install_kernel
2010-11-19 06:13:59,295 INFO : Done.
2010-11-19 06:14:04,841 INFO : Running depmod.
2010-11-19 06:14:04,996 INFO : update-initramfs: Generating /boot/initrd.img-2.6.32-25-server
2010-11-19 06:14:09,531 INFO : Running postinst hook script /usr/sbin/update-grub.
2010-11-19 06:14:09,747 INFO : Searching for GRUB installation directory ... found: /boot/grub
2010-11-19 06:14:09,902 INFO : Searching for default file ... found: /boot/grub/default
2010-11-19 06:14:09,906 INFO : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
2010-11-19 06:14:10,175 INFO : Searching for splash image ... none found, skipping ...
2010-11-19 06:14:10,286 INFO : Found kernel: /boot/vmlinuz-2.6.32-25-server
2010-11-19 06:14:10,524 INFO : Replacing config file /var/run/grub/menu.lst with new version
2010-11-19 06:14:10,581 INFO : Updating /boot/grub/menu.lst ... done
2010-11-19 06:14:10,581 INFO :
2010-11-19 06:14:11,034 INFO : Calling hook: unmount_partitions
2010-11-19 06:14:11,035 INFO : Unmounting target filesystem
2010-11-19 06:14:15,115 INFO : Calling hook: convert
2010-11-19 06:14:15,116 INFO : Calling hook: deploy
Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/contrib/cli.py", line 121, in main
    hypervisor.finalise(destdir)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/hypervisor.py", line 78, in finalise
    self.call_hooks('deploy', destdir)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/distro.py", line 66, in call_hooks
    call_hooks(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/util.py", line 165, in call_hooks
    getattr(context, func, log_no_such_method)(*args, **kwargs)
TypeError: deploy() takes exactly 1 argument (2 given)

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: python-vm-builder 0.12.4-0ubuntu1.1 [modified: usr/share/pyshared/VMBuilder/plugins/virtualbox/vm.py]
ProcVersionSignature: Ubuntu 2.6.35-22.35-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic x86_64
NonfreeKernelModules: wl
Architecture: amd64
Date: Fri Nov 19 10:26:45 2010
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=it_IT.utf8
 SHELL=/bin/bash
SourcePackage: vm-builder

Revision history for this message
Dario Bertini (berdario) wrote :
Revision history for this message
Dario Bertini (berdario) wrote :

I noticed a strange thing:

when supplying and invalid hypervisor to vmbuilder, it lets you know that

Available hypervisors: vmserver esxi xen kvm vbox vmw6 qemu

and yet, from the manual:

http://manpages.ubuntu.com/manpages/maverick/en/man1/vmbuilder.1.html

Valid options: xen kvm vmw6 vmserver

if indeed with any of the hypervisor from the first list, that're not included in the second, vmbuilder fails... then maybe this could be simply a matter of removing obsolete and unsupported hypevisors types

Revision history for this message
James Page (james-page) wrote :

After applying the fix in bug 580237 to resolve another vbox bug I can confirm that I see the same issue on maverick.

The signature of the deploy function in /usr/lib/python2.6/dist-packages/VMBuilder/plugins/virtualbox/vm.py is

    def deploy(self):

I think that vm-builder is expecting:

    def deploy(self, destdir):

(taken from kvm plugin code).

Changed in vm-builder (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Antti Kaihola (akaihola) wrote :

Like James Page, I applied the fix in bug 580237 and run

    $ sudo vmbuilder vbox ubuntu --suite lucid

on my Maverick box and got the traceback mentioned above.

Revision history for this message
Juan Moyano (wincus) wrote :

I'm getting the same error here, (running Ubuntu Natty)

$ sudo ubuntu-vm-builder vbox lucid --addpkg vim
[ .... ]
2011-05-05 14:18:18,838 INFO : Calling hook: unmount_partitions
2011-05-05 14:18:18,839 INFO : Unmounting target filesystem
2011-05-05 14:18:22,792 INFO : Calling hook: convert
2011-05-05 14:18:22,793 INFO : Calling hook: deploy
2011-05-05 14:18:22,795 INFO : Cleaning up
Traceback (most recent call last):
  File "/usr/bin/ubuntu-vm-builder", line 24, in <module>
    uvb.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 165, in call_hooks
    getattr(context, func, log_no_such_method)(*args, **kwargs)
TypeError: deploy() takes exactly 1 argument (2 given)

Revision history for this message
tanktarta (tanktarta) wrote :

This patch fixes the bug for me. It also adds some missing arguments, I need to be able to set memory amount (-m), and that was lost too.

tags: added: patch
Revision history for this message
tanktarta (tanktarta) wrote :

Sorry, that last patch was bad. Here it is again.

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.