diff options
author | Oliver Tappe | 2007-12-28 18:55:25 +0100 |
---|---|---|
committer | Oliver Tappe | 2007-12-28 18:55:25 +0100 |
commit | b27afb64e9d2b18e524ef3c957baa530ed5f9904 (patch) | |
tree | 2376e0a39d2cb2b714667a7943ff28ee6d09ca85 /config-db/OpenSLX/ConfigDB.pm | |
parent | * added more tests for basic DB-features: group, global_info and (diff) | |
download | core-b27afb64e9d2b18e524ef3c957baa530ed5f9904.tar.gz core-b27afb64e9d2b18e524ef3c957baa530ed5f9904.tar.xz core-b27afb64e9d2b18e524ef3c957baa530ed5f9904.zip |
* completed basic tests and started to work on tests for aggregated values
(attributes)
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1436 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/OpenSLX/ConfigDB.pm')
-rw-r--r-- | config-db/OpenSLX/ConfigDB.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm index 9030311d..f4f9b0e2 100644 --- a/config-db/OpenSLX/ConfigDB.pm +++ b/config-db/OpenSLX/ConfigDB.pm @@ -1246,6 +1246,9 @@ sub setClientIDsOfSystem my $systemID = shift; my $clientIDs = _aref(shift); + # associating a client to the default system makes no sense + return 0 if $systemID == 0; + my @uniqueClientIDs = _unique(@$clientIDs); return $self->{'meta-db'}->setClientIDsOfSystem( @@ -1355,6 +1358,9 @@ sub setGroupIDsOfSystem my $systemID = shift; my $groupIDs = _aref(shift); + # associating a group to the default system makes no sense + return 0 if $systemID == 0; + my @uniqueGroupIDs = _unique(@$groupIDs); return $self->{'meta-db'}->setGroupIDsOfSystem($systemID, \@uniqueGroupIDs); @@ -1558,7 +1564,8 @@ sub setSystemIDsOfClient my $clientID = shift; my $systemIDs = _aref(shift); - my @uniqueSystemIDs = _unique(@$systemIDs); + # filter out the default system, as no client should be associated to it + my @uniqueSystemIDs = grep { $_ > 0; } _unique(@$systemIDs); return $self->{'meta-db'}->setSystemIDsOfClient( $clientID, \@uniqueSystemIDs @@ -1972,7 +1979,8 @@ sub setSystemIDsOfGroup my $groupID = shift; my $systemIDs = _aref(shift); - my @uniqueSystemIDs = _unique(@$systemIDs); + # filter out the default system, as no group should be associated to it + my @uniqueSystemIDs = grep { $_ > 0; } _unique(@$systemIDs); return $self->{'meta-db'}->setSystemIDsOfGroup($groupID, \@uniqueSystemIDs); } |