diff options
author | Oliver Tappe | 2007-12-29 15:55:18 +0100 |
---|---|---|
committer | Oliver Tappe | 2007-12-29 15:55:18 +0100 |
commit | b669004e354102de77458600b8be705032d375a4 (patch) | |
tree | 09c982a5aca15c397073bd36212a12fd20e9f03b /config-db/OpenSLX | |
parent | * completed basic tests and started to work on tests for aggregated values (diff) | |
download | core-b669004e354102de77458600b8be705032d375a4.tar.gz core-b669004e354102de77458600b8be705032d375a4.tar.xz core-b669004e354102de77458600b8be705032d375a4.zip |
* 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
Diffstat (limited to 'config-db/OpenSLX')
-rw-r--r-- | config-db/OpenSLX/ConfigDB.pm | 30 |
1 files changed, 19 insertions, 11 deletions
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)) { |