admserv/newinst/src/25changefedorato389.pl | 36 +++++++++++++++--------------
admserv/newinst/src/AdminMigration.pm.in | 8 +++++-
2 files changed, 26 insertions(+), 18 deletions(-)
New commits:
commit d2610ddb92855ba3e2535f3c9b1b4461c040bf69
Author: Endi S. Dewata <edewata(a)redhat.com>
Date: Mon Oct 18 13:00:45 2010 -0400
Bug 644929 - FDS to 389 DS migration results in both Fedora and 389 entries
https://bugzilla.redhat.com/show_bug.cgi?id=644929
There is a problem introduced in the fix for bug #573889 that goes
undetected causing the server to end up with both Fedora and 389 entries.
The invocation of updateDS() has been fixed to check for any errors.
The upgrade script 25changefedorato389.pl has been modified to
check whether local.conf already exists. If it does, it means the
server is being upgraded so the script will perform the changes.
If the file doesn't exist, that means the server is being migrated
so the script will skip it and migratePset() will create it later
on. If there are no errors the script will remove the Fedora entries
properly.
diff --git a/admserv/newinst/src/25changefedorato389.pl
b/admserv/newinst/src/25changefedorato389.pl
index 531ada1..3cccce6 100644
--- a/admserv/newinst/src/25changefedorato389.pl
+++ b/admserv/newinst/src/25changefedorato389.pl
@@ -190,26 +190,28 @@ sub pre {
}
my $localconf = "$configdir/admin-serv/local.conf";
- if (!open(LOCALCONF, "$localconf")) {
- return ('error_reading_conffile', $localconf, $!);
- }
- my @lines = <LOCALCONF>;
- close LOCALCONF;
- $count = 0; # reset
- for my $line (@lines) {
- $count += ($line =~ s/cn=Fedora/cn=389/g); # fix DNs
- $count += ($line =~ s/\@fedora-admin/\@389-admin/g); # fix jar names
- $count += ($line =~ s/\@fedora-ds/\@389-ds/g); # fix jar names
- }
-
- if ($count > 0) {
- if (!open(LOCALCONF, ">$localconf")) {
- return ('error_updating_conffile', $localconf, $!);
+ if (-f $localconf) {
+ if (!open(LOCALCONF, "$localconf")) {
+ return ('error_reading_conffile', $localconf, $!);
}
+ my @lines = <LOCALCONF>;
+ close LOCALCONF;
+ $count = 0; # reset
for my $line (@lines) {
- print LOCALCONF $line;
+ $count += ($line =~ s/cn=Fedora/cn=389/g); # fix DNs
+ $count += ($line =~ s/\@fedora-admin/\@389-admin/g); # fix jar names
+ $count += ($line =~ s/\@fedora-ds/\@389-ds/g); # fix jar names
+ }
+
+ if ($count > 0) {
+ if (!open(LOCALCONF, ">$localconf")) {
+ return ('error_updating_conffile', $localconf, $!);
+ }
+ for my $line (@lines) {
+ print LOCALCONF $line;
+ }
+ close LOCALCONF;
}
- close LOCALCONF;
}
# config files were successfully updated - delete the old entries
diff --git a/admserv/newinst/src/AdminMigration.pm.in
b/admserv/newinst/src/AdminMigration.pm.in
index 40ba860..5fad60b 100644
--- a/admserv/newinst/src/AdminMigration.pm.in
+++ b/admserv/newinst/src/AdminMigration.pm.in
@@ -503,11 +503,17 @@ sub migrateAdminServer {
$mig->{inf}->{configdsconn} = $conn;
$mig->{inf}->{slapd}->{updatedir} = "@updatedir@";
- if (updateDS($mig)) {
+ my @errs;
+ if (@errs = updateDS($mig)) {
$conn->close();
+ $mig->msg(@errs);
return 0;
}
+ my $admConf = getAdmConf($configdir);
+ $mig->{inf}->{admin}->{sie} = $admConf->{sie};
+ $mig->{inf}->{admin}->{isie} = $admConf->{isie};
+
if (!migratePset($mig, $configdir)) {
$conn->close();
return 0;