diff options
author | Oliver Tappe | 2008-02-23 19:44:04 +0100 |
---|---|---|
committer | Oliver Tappe | 2008-02-23 19:44:04 +0100 |
commit | 494241071bd94d5e4b87ba113753642e57090af8 (patch) | |
tree | 3da20fea677f6be344826c3b599528022e8ad590 /os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm | |
parent | * Instead of giving up when a plugin folder does not contain the corresponding (diff) | |
download | core-494241071bd94d5e4b87ba113753642e57090af8.tar.gz core-494241071bd94d5e4b87ba113753642e57090af8.tar.xz core-494241071bd94d5e4b87ba113753642e57090af8.zip |
* adjusted plugin-API according to recent discussion with Volker:
+ dropped pre- and post-methods as they are not really needed, since ...
+ we now bind-mount /opt/openslx into /mnt/openslx of the vendor-OS chroot,
so plugins can copy any required files from there
* cleaned up existing plugin implementations
* improved documentation for plugin developers (available via
'perldoc os-plugins/OpenSLX/OSPlugins/Base.pm').
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1570 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm')
-rw-r--r-- | os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm index 91ff3289..af4df603 100644 --- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm +++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm @@ -18,6 +18,8 @@ use warnings; use base qw(OpenSLX::OSPlugin::Base); +use File::Path; + use OpenSLX::Basics; use OpenSLX::Utils; @@ -90,27 +92,33 @@ sub getAttrInfo }; } -sub preInstallationPhase -{ # called before chrooting into vendor-OS root, should be used if any files - # have to be downloaded outside of the chroot (which might be necessary - # if the required files can't be installed via the meta-packager) - my $self = shift; +sub installationPhase +{ + my $self = shift; my $pluginRepositoryPath = shift; - # the folder where the stage1-plugin should store all files - # required by the corresponding stage3 runlevel script - my $pluginTempPath = shift; - # a temporary playground that will be cleaned up automatically + my $pluginTempPath = shift; + my $openslxPath = shift; # get path of files we need to install - my $pluginName = $self->{'name'}; - my $pluginFilesPath - = "$openslxConfig{'base-path'}/lib/plugins/$pluginName/files"; + my $pluginFilesPath = "$openslxPath/lib/plugins/$self->{'name'}/files"; # copy all needed files now - my @files = ("dhcpd.conf", "nat.conf", "nvram.5.0", "runvmware-v2"); + my @files = qw( dhcpd.conf nat.conf nvram.5.0 runvmware-v2 ); foreach my $file (@files) { - copyFile("$pluginFilesPath/$file", "$pluginRepositoryPath"); + copyFile("$pluginFilesPath/$file", $pluginRepositoryPath); } } +sub removalPhase +{ + my $self = shift; + my $pluginRepositoryPath = shift; + my $pluginTempPath = shift; + my $openslxPath = shift; + + rmtree ( [ $pluginRepositoryPath ] ); + + return; +} + 1; |