1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import os
20 import VMBuilder
21 from VMBuilder.util import run_cmd
22
24 for plugin in find_plugins():
25 exec "import %s" % plugin
26
28 retval = []
29 for plugin_dir in __path__:
30 for p in os.listdir(plugin_dir):
31 path = '%s/%s' % (plugin_dir, p)
32 if os.path.isdir(path) and os.path.isfile('%s/__init__.py' % path):
33 retval.append("VMBuilder.plugins.%s" % p)
34 return retval
35
40
43
46
48 """
49 Override this method with checks for anything that might cause the VM creation to fail
50
51 raise an exception if you can see already that this won't work
52 """
53 pass
54
55 - def post_install(self):
56 """
57 This is called just after the distro is installed, before it gets copied to the fs images.
58 """
59 pass
60
62 """
63 Perform deployment of the VM.
64
65 If True is returned, no further deployment will be done.
66 """
67 return False
68
73
75 if not self.vm.fsmounted:
76 raise VMBuilderException('install_from_template called while file system is not mounted')
77 return run_cmd('chroot', self.vm.installdir, *args, **kwargs)
78