From 219bd69fb2ec6ece60f512b97dd525b5287d52b3 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Fri, 19 Oct 2007 01:50:15 +0000 Subject: Resolves: bug 338991 Bug Description: obsolete values migrated to target instance Reviewed by: nhosoi (Thanks!) Fix Description: When fixing the attributes in the old entry, remove any obsolete attributes. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none --- ldap/admin/src/scripts/DSMigration.pm.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ldap/admin/src/scripts') diff --git a/ldap/admin/src/scripts/DSMigration.pm.in b/ldap/admin/src/scripts/DSMigration.pm.in index a617e8c4..0de30740 100644 --- a/ldap/admin/src/scripts/DSMigration.pm.in +++ b/ldap/admin/src/scripts/DSMigration.pm.in @@ -549,7 +549,11 @@ sub fixAttrsInEntry { my ($ent, $mig, $inst) = @_; for my $attr (keys %{$ent}) { my $lcattr = lc $attr; - if ($transformAttr{$lcattr}) { + if ($ignoreOld{$lcattr}) { + debug(3, "fixAttrsInEntry: ignoring old invalid or obsolete attr $attr\n"); + $ent->remove($attr); + next; + } elsif ($transformAttr{$lcattr}) { my $newval = &{$transformAttr{$lcattr}}($ent, $attr, $mig, $inst); if (!$newval) { debug(2, "Removing attribute $attr from entry ", $ent->getDN(), "\n"); @@ -558,7 +562,7 @@ sub fixAttrsInEntry { debug(2, "Setting new value $newval for attribute $attr in entry ", $ent->getDN(), "\n"); $ent->setValues($attr, $newval); } - } + } # else just keep as is } } -- cgit