Author: rmeggins
Update of /cvs/dirsec/adminserver/admserv/newinst/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5779/adminserver/admserv/newinst/src
Modified Files:
migrate-ds-admin.pl.in setup-ds-admin.pl.in
Log Message:
Resolves: bug 248145
Bug Description: Replace ds_newinst binary with perl script - remove dead code
Reviewed by: nhosoi (Thanks!)
Fix Description: This is my favorite part - removing all of the now dead code. I also had to fix the exit code so that you could use $? to test for the success or failure of the new setup scripts.
Platforms tested: RHEL4, FC6
Flag Day: no
Doc impact: no
Index: migrate-ds-admin.pl.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/migrate-ds-admin.pl.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- migrate-ds-admin.pl.in 13 Jul 2007 18:39:15 -0000 1.4
+++ migrate-ds-admin.pl.in 18 Jul 2007 20:43:14 -0000 1.5
@@ -60,7 +60,7 @@
if (!$mig->{inf}->{General}->{ConfigDirectoryAdminPwd}) {
$mig->msg('error_configds_adminpwd_required');
- exit 1;
+ $mig->doExit(1);
}
# first, migrate directory server instances
@@ -68,7 +68,7 @@
# should have already migrated the config DS
$mig->msg('begin_ds_migration', $mig->{oldsroot});
if (!migrateDS($mig)) {
- exit 1;
+ $mig->doExit(1);
}
# if the config ds is on the local machine, shut down the old one
@@ -83,7 +83,7 @@
# next, migrate the admin server - this also registers the directory servers
$mig->msg('begin_as_migration', $mig->{oldsroot});
if (!migrateAdminServer($mig)) {
- exit 1;
+ $mig->doExit(1);
}
# next, register/update the new directory servers
@@ -94,17 +94,17 @@
$mig->{configdir},
@{$mig->{instances}})) {
$mig->msg($FATAL, @errs);
- exit 1;
+ $mig->doExit(1);
}
$mig->msg('end_dsadmin_migration');
+$mig->doExit(0);
+
END {
if ($mig) {
if (!$mig->{keep}) {
unlink $mig->{inffile};
}
-
- $mig->doExit();
}
}
Index: setup-ds-admin.pl.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/setup-ds-admin.pl.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- setup-ds-admin.pl.in 13 Jul 2007 18:39:15 -0000 1.8
+++ setup-ds-admin.pl.in 18 Jul 2007 20:43:14 -0000 1.9
@@ -123,7 +123,7 @@
my $rc = $dialogmgr->run();
if ($rc) {
- $setup->doExit();
+ $setup->doExit($rc);
}
}
@@ -150,7 +150,7 @@
if (@errs) {
$setup->msg(@errs);
$setup->msg($FATAL, 'error_creating_dsinstance', $setup->{inf}->{slapd}->{ServerIdentifier});
- exit 1;
+ $setup->doExit(1);
} else {
$setup->msg('created_dsinstance', $setup->{inf}->{slapd}->{ServerIdentifier});
}
@@ -161,7 +161,7 @@
if (!createConfigDS($setup->{inf}, \@errs)) {
$setup->msg($FATAL, @errs);
$setup->msg($FATAL, 'error_create_configds');
- exit 1;
+ $setup->doExit(1);
}
}
else
@@ -170,7 +170,7 @@
if (!createSubDS($setup->{inf}, \@errs)) {
$setup->msg($FATAL, @errs);
$setup->msg($FATAL, 'error_create_configds');
- exit 1;
+ $setup->doExit(1);
}
}
@@ -180,7 +180,7 @@
$setup->{inf})) {
$setup->msg(@errs);
$setup->msg($FATAL, 'error_register_dirserver');
- exit 1;
+ $setup->doExit(1);
}
@@ -188,23 +188,21 @@
if (!$setup->{reconfigas}) {
if (!createAdminServer($setup)) {
$setup->msg($FATAL, 'error_create_adminserver');
- exit 1;
+ $setup->doExit(1);
}
} else {
if (!reconfigAdminServer($setup)) {
$setup->msg($FATAL, 'error_reconfig_adminserver');
- exit 1;
+ $setup->doExit(1);
}
}
-$setup->msg($SUCCESS, 'setup_complete');
+$setup->doExit(0);
END {
if ($setup) {
if (!$setup->{keep}) {
unlink $setup->{inffile};
}
-
- $setup->doExit();
}
}