summaryrefslogtreecommitdiffstats
path: root/config-db/OpenSLX
diff options
context:
space:
mode:
authorOliver Tappe2007-12-28 18:55:25 +0100
committerOliver Tappe2007-12-28 18:55:25 +0100
commitb27afb64e9d2b18e524ef3c957baa530ed5f9904 (patch)
tree2376e0a39d2cb2b714667a7943ff28ee6d09ca85 /config-db/OpenSLX
parent* added more tests for basic DB-features: group, global_info and (diff)
downloadcore-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')
-rw-r--r--config-db/OpenSLX/ConfigDB.pm12
-rw-r--r--config-db/OpenSLX/DBSchema.pm1
2 files changed, 11 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);
}
diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm
index 81a68399..6600edca 100644
--- a/config-db/OpenSLX/DBSchema.pm
+++ b/config-db/OpenSLX/DBSchema.pm
@@ -260,6 +260,7 @@ if ($lang =~ m[^\w\w_(\w\w)]) {
{ # add default system
'id' => 0,
'name' => '<<<default>>>',
+ 'hidden' => 1,
'comment' => 'internal system that holds default values',
# system-only attributes:
'attr_ramfs_nicmods'