From 2a614b1103699d60e7e2999030d64e2adc9a6955 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 22 May 2008 20:01:34 +0000 Subject: * attributes set via slxconfig are now being checked not only against the respective regex, but the corresponding plugin is being invoked to do a check of its own, too (where it has the chance to look at the vendor-OS attributes and determine the possible stage3-values from their state). * listing a vendor-OS in verbose mode now shows the vendor-OS attributes (stage1 & stage3), too * used Clone::clone instead of Storable::dclone since the latter is not capable of cloning compiled regexes git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1783 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/OpenSLX/OSPlugin/Engine.pm | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'os-plugins/OpenSLX/OSPlugin/Engine.pm') diff --git a/os-plugins/OpenSLX/OSPlugin/Engine.pm b/os-plugins/OpenSLX/OSPlugin/Engine.pm index 0672aa5e..ada0af79 100644 --- a/os-plugins/OpenSLX/OSPlugin/Engine.pm +++ b/os-plugins/OpenSLX/OSPlugin/Engine.pm @@ -126,6 +126,7 @@ sub initialize ? $dbAttrs->{$attrName} : $defaultAttrs->{$attrName}->{default}; } + $self->{'vendorOS-attrs'} = $dbAttrs; } return 1; @@ -377,7 +378,6 @@ sub getInstallablePackagesForSelection ); } - =item installPackages($packages) Installs the given packages into the vendor-OS. @@ -447,6 +447,44 @@ sub removePackages =back +=head2 Driver Interface + +The following methods are invoked by the slxos-plugin script in order to +install/remove a plugin into/from a vendor-OS: + +=over + +=item checkStage3AttrValues() + +Checks if the stage3 values given in B<$stage3Attrs> are allowed and make sense. + +If all values are ok, this method returns 1 - if not, it dies with an +appropriate message. + +This method chroots into the vendor-OS and then asks the plugin itself to check +the attributes. + +=cut + +sub checkStage3AttrValues +{ + my $self = shift; + my $stage3Attrs = shift; + + $self->_callChrootedFunctionForPlugin( + sub { + # let plugin check by itself + $self->{plugin}->checkStage3AttrValues( + $stage3Attrs, $self->{'vendorOS-attrs'} + ); + } + ); + + return 1; +} + +=back + =cut sub _loadPlugin -- cgit v1.2.3-55-g7522