~lifeless/ubuntu/lucid/vm-builder/fixes

« back to all changes in this revision

Viewing changes to VMBuilder/plugins/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen, Nicolas Barcet, Soren Hansen
  • Date: 2008-10-03 18:52:06 UTC
  • Revision ID: james.westby@ubuntu.com-20081003185206-pacbery3cmauq9do
Tags: 0.9-0ubuntu2
[ Nicolas Barcet ]
* Added hint for more help (LP: #269323)
* Added firstscripts plugin to fix regression on --firstboot and --firstlogin (LP: #268957)
* Added postinst plugin to fix regression on --exec and add --copy (LP: #268955) 
* Added man page.

[ Soren Hansen ]
* Include ubuntu-vm-builder package. (LP: #277272)
* Read additional config file given by '-c'. (LP: #276813)
* Fix regression from ubuntu-vm-builder: Make output from subprocess
  non-buffered.
* Let --overwrite apply for libvirt as well. (LP: #276322)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
19
#
20
20
import os
 
21
import VMBuilder
21
22
 
22
23
def load_plugins():
23
24
    for plugin in find_plugins():
44
45
        pass
45
46
 
46
47
    def preflight_check(self):
47
 
        """Override this method with checks for anything that might cause the VM creation to fail
 
48
        """
 
49
        Override this method with checks for anything that might cause the VM creation to fail
48
50
        
49
51
        raise an exception if you can see already that this won't work
50
52
        """
51
53
        pass
52
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
 
53
61
    def deploy(self):
 
62
        """
 
63
        Perform deployment of the VM.
 
64
 
 
65
        If True is returned, no further deployment will be done.
 
66
        """
54
67
        return False
 
68
 
 
69
    def install_from_template(self, path, tmplname, context=None, mode=None):
 
70
        return self.vm.install_file(path, VMBuilder.util.render_template(self.__module__.split('.')[2], self.vm, tmplname, context), mode=mode)