浏览代码

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

Rich Megginson 18 年之前
父节点
当前提交
219bd69fb2
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      ldap/admin/src/scripts/DSMigration.pm.in

+ 6 - 2
ldap/admin/src/scripts/DSMigration.pm.in

@@ -549,7 +549,11 @@ sub fixAttrsInEntry {
     my ($ent, $mig, $inst) = @_;
     my ($ent, $mig, $inst) = @_;
     for my $attr (keys %{$ent}) {
     for my $attr (keys %{$ent}) {
         my $lcattr = lc $attr;
         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);
             my $newval = &{$transformAttr{$lcattr}}($ent, $attr, $mig, $inst);
             if (!$newval) {
             if (!$newval) {
                 debug(2, "Removing attribute $attr from entry ", $ent->getDN(), "\n");
                 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");
                 debug(2, "Setting new value $newval for attribute $attr in entry ", $ent->getDN(), "\n");
                 $ent->setValues($attr, $newval);
                 $ent->setValues($attr, $newval);
             }
             }
-        }
+        } # else just keep as is
     }
     }
 }
 }