From b669004e354102de77458600b8be705032d375a4 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 29 Dec 2007 14:55:18 +0000 Subject: * completed test set for attribute merging, fixing several bugs along the way - these tests expose the known problem of attributes not being resetable by higher priority layers (you can't set attr_start_xdmcp to '' in a client if it set by a system). git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1437 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/OpenSLX/ConfigDB.pm | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'config-db/OpenSLX') diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm index f4f9b0e2..9b6218cb 100644 --- a/config-db/OpenSLX/ConfigDB.pm +++ b/config-db/OpenSLX/ConfigDB.pm @@ -2158,14 +2158,19 @@ sub mergeDefaultAndGroupAttributesIntoClient # step over all groups this client belongs to # (ordered by priority from highest to lowest): - my @groupIDs = $self->fetchGroupIDsOfClient($client->{id}); - my @groups = - sort { $a->{priority} <=> $b->{priority} } - $self->fetchGroupByID(\@groupIDs); + my @groupIDs = _unique( + $self->fetchGroupIDsOfClient(0), + $self->fetchGroupIDsOfClient($client->{id}) + ); + my @groups + = sort { $a->{priority} <=> $b->{priority} } + $self->fetchGroupByID(\@groupIDs); foreach my $group (@groups) { # merge configuration from this group into the current client: - vlog(3, - _tr('merging from group %d:%s...', $group->{id}, $group->{name})); + vlog( + 3, + _tr('merging from group %d:%s...', $group->{id}, $group->{name}) + ); mergeAttributes($client, $group); } @@ -2251,8 +2256,10 @@ sub aggregatedClientIDsOfSystem # add *all* client-IDs if the system is being referenced by # the default client, as that means that all clients should offer # this system for booting: - push @clientIDs, - map { $_->{id} } $self->fetchClientByFilter(undef, 'id'); + push( + @clientIDs, + map { $_->{id} } $self->fetchClientByFilter(undef, 'id') + ); } # step over all groups this system belongs to: @@ -2317,8 +2324,8 @@ sub aggregatedSystemFileInfoFor # check if the specified kernel file really exists (follow links while # checking) and if not, find the newest kernel file that is available. - my $kernelPath = - "$openslxConfig{'private-path'}/stage1/$vendorOS->{name}/boot"; + my $kernelPath + = "$openslxConfig{'private-path'}/stage1/$vendorOS->{name}/boot"; my $kernelFile = "$kernelPath/$system->{kernel}"; while (-l $kernelFile) { $kernelFile = followLink($kernelFile); @@ -2409,7 +2416,8 @@ sub mergeAttributes my $target = shift; my $source = shift; - foreach my $key (grep { isAttribute($_) } keys %$source) { + foreach my $key (keys %$source) { + next if !isAttribute($key); my $sourceVal = $source->{$key} || ''; my $targetVal = $target->{$key} || ''; if (length($sourceVal) && !length($targetVal)) { -- cgit v1.2.3-55-g7522