diff options
-rw-r--r-- | config-db/OpenSLX/AttributeRoster.pm | 8 | ||||
-rwxr-xr-x | config-db/slxconfig | 18 | ||||
-rw-r--r-- | os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm | 2 |
3 files changed, 23 insertions, 5 deletions
diff --git a/config-db/OpenSLX/AttributeRoster.pm b/config-db/OpenSLX/AttributeRoster.pm index 13c7640d..61825f77 100644 --- a/config-db/OpenSLX/AttributeRoster.pm +++ b/config-db/OpenSLX/AttributeRoster.pm @@ -510,7 +510,7 @@ sub checkValues { my $class = shift; my $stage3Attrs = shift || {}; - my $vendorOSName = shift or die ('need vendor-OS-name!'); + my $vendorOSName = shift; $class->_init() if !%AttributeInfo; @@ -538,6 +538,10 @@ sub checkValues } } + # if no vendorOS-name has been provided, we can't initialize any plugins, + # so we are done + return 1 if !$vendorOSName; + # now give each plugin a chance to check it's own attributes by itself foreach my $pluginName (sort keys %attrsByPlugin) { # create & start OSPlugin-engine for vendor-OS and current plugin @@ -549,6 +553,8 @@ sub checkValues } $engine->checkStage3AttrValues($attrsByPlugin{$pluginName}); } + + return 1; } 1; diff --git a/config-db/slxconfig b/config-db/slxconfig index 5592e06d..d4656e5e 100755 --- a/config-db/slxconfig +++ b/config-db/slxconfig @@ -269,9 +269,13 @@ sub checkGivenStage3Attrs my $stage3Attrs = shift; my $vendorOSID = shift; - my $vendorOS = $openslxDB->fetchVendorOSByID($vendorOSID); - - OpenSLX::AttributeRoster->checkValues($stage3Attrs, $vendorOS->{name}); + if ($vendorOSID) { + my $vendorOS = $openslxDB->fetchVendorOSByID($vendorOSID); + OpenSLX::AttributeRoster->checkValues($stage3Attrs, $vendorOS->{name}); + } + else { + OpenSLX::AttributeRoster->checkValues($stage3Attrs); + } return 1; } @@ -711,6 +715,8 @@ sub addClientToConfigDB ); $clientData->{name} = $clientName; + checkGivenStage3Attrs($clientData->{attrs}); + my @systemIDs; if (exists $clientData->{systems}) { @systemIDs = map { @@ -778,6 +784,8 @@ sub addGroupToConfigDB ); $groupData->{name} = $groupName; + checkGivenStage3Attrs($groupData->{attrs}); + my @systemIDs; if (exists $groupData->{systems}) { @systemIDs = map { @@ -951,6 +959,8 @@ sub changeClientInConfigDB $clientName); } + checkGivenStage3Attrs($clientData->{attrs}); + mergeNonExistingAttributes($clientData, $client); my @systemIDs; @@ -1038,6 +1048,8 @@ sub changeGroupInConfigDB $groupName); } + checkGivenStage3Attrs($groupData->{attrs}); + mergeNonExistingAttributes($groupData, $group); my (@systemIDs, @clientIDs); diff --git a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm index 92b1e9a9..61787309 100644 --- a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm +++ b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm @@ -299,7 +299,7 @@ sub checkStage3AttrValues my $theme = $stage3Attrs->{'desktop::theme'}; if (defined $theme && !grep { $_ eq $theme } @supportedThemes) { die _tr( - "'%s' is not a supported theme!\nSupported themes are: %s", + "desktop::theme '%s' does not refer to a supported theme!\nSupported themes are: %s", $theme, $vendorOSAttrs->{'desktop::supported_themes'} || '' ); } |