[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DSMigration.pm.in, 1.13, 1.14

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Fri Sep 14 21:24:15 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13579/ldapserver/ldap/admin/src/scripts

Modified Files:
	DSMigration.pm.in 
Log Message:
Resolves: bug 288451
Bug Description: Show-Stopper - Migration from HP-PARISC DS 6.21 to DS80 on HP-Itaninum
Reviewed by: nhosoi (Thanks!)
Fix Description: These are additional fixes for various and sundry problems:
1) If doing cross platform migration, just use the default db and changelog db dirs
2) If doing same platform migration, try to keep the db dir if the user has changed it.  It will usually be changed for a good reason, like moving to a separate device for performance reasons.  In order to see if the directory has changed, we need to "normalize" the path in the attribute so that we can compare it correctly.
3) Do not migrate the attributes nsslapd-db-private-import-mem and nsslapd-import-cache-autosize - just use the new default values for these
4) Do not migrate nsslapd-allidsthreshold - this has been removed
5) Add additional error checking and handling when migrating the local.conf information.
6) Change the brand in the sie and isie when migrating.
7) Update the Group in console.conf during migration.
Platforms tested: HP-UX 11.23 IPF64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none



Index: DSMigration.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSMigration.pm.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- DSMigration.pm.in	14 Sep 2007 16:26:17 -0000	1.13
+++ DSMigration.pm.in	14 Sep 2007 21:24:12 -0000	1.14
@@ -56,6 +56,9 @@
 use File::Temp qw(tempfile tempdir);
 use File::Basename qw(basename);
 
+# absolute path handling
+use Cwd qw(realpath);
+
 # load perldap
 use Mozilla::LDAP::Conn;
 use Mozilla::LDAP::Utils qw(normalizeDN);
@@ -104,7 +107,14 @@
  'nsslapd-ldapigidnumbertype'      => 'nsslapd-ldapigidnumbertype',
  'nsslapd-ldapientrysearchbase'    => 'nsslapd-ldapientrysearchbase',
  'nsslapd-ldapiautodnsuffix'       => 'nsslapd-ldapiautodnsuffix',
- 'numsubordinates'                 => 'numSubordinates'
+ 'numsubordinates'                 => 'numSubordinates',
+ # for these, we just want to use the default values, even if they were
+ # set in 7.1 or later
+ 'nsslapd-db-private-import-mem'   => 'nsslapd-db-private-import-mem',
+ 'nsslapd-import-cache-autosize'   => 'nsslapd-import-cache-autosize',
+ # nsslapd-allidsthreshold does not exist anymore
+ # the analogous concept is nsslapd-idlistscanlimit for searches
+ 'nsslapd-allidsthreshold'         => 'nsslapd-allidsthreshold'
 );
 
 # these are the obsolete entries we do not migrate
@@ -126,19 +136,23 @@
 
 sub getNewDbDir {
     my ($ent, $attr, $mig, $inst) = @_;
+    my $newval;
     my %objclasses = map { lc($_) => $_ } $ent->getValues('objectclass');
     my $cn = $ent->getValues('cn');
-    my $oldval = $ent->getValues($attr);
-    my $newval;
     # there is one case where we want to just use the existing db directory
     # that's the case where the user has moved the indexes and/or the
     # transaction logs to different partitions for performance
     # in that case, the old directory will not be the same as the default,
     # and the directory will exist
-    my $olddefault = "$mig->{actualsroot}/$inst";
-    if (-d $oldval and ($oldval !~ /^$olddefault/)) {
-        debug(2, "Keeping old value [$oldval] for attr $attr in entry ", $ent->getDN(), "\n");
-        return $oldval;
+    # for cross platform, we should just use the new default location
+    if (!$mig->{crossplatform}) {
+        my $oldval = $ent->getValues($attr);
+        my $absoldval = realpath($oldval) || $oldval;
+        my $olddefault = "$mig->{actualsroot}/$inst";
+        if (-d $absoldval and ($absoldval !~ /^$olddefault/)) {
+            debug(2, "Keeping old value [$absoldval] for attr $attr in entry ", $ent->getDN(), "\n");
+            return $oldval;
+        }
     }
     # otherwise, just use the new default locations
     if ("@with_fhs_opt@") {




More information about the Fedora-directory-commits mailing list