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