diff options
author | John Dennis <jdennis@redhat.com> | 2012-04-04 15:19:29 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2012-04-04 22:47:08 -0400 |
commit | af0ac845ff2ebb5a7c045acdc17dc656522039aa (patch) | |
tree | e9ea9b839d5c02bdeee469efbaaf1a7bf40b6328 /ipaserver/install/cainstance.py | |
parent | cdebb29fecdd959808b4f0ea0245e371eba06eae (diff) | |
download | freeipa-af0ac845ff2ebb5a7c045acdc17dc656522039aa.tar.gz freeipa-af0ac845ff2ebb5a7c045acdc17dc656522039aa.tar.xz freeipa-af0ac845ff2ebb5a7c045acdc17dc656522039aa.zip |
improve handling of ds instances during uninstall
Ticket #2502
* remove the "running" flag from backup_state in cainstance.py and
dsinstance.py because it does not provide the correct
information. In cainstance the running flag was never referenced
because restarting dirsrv instances occurs later in dsinstance. In
dsinstance when the running flag is set it incorrectly identifed the
PKI ds instance configured earlier by cainstance. The intent was to
determine if there were any ds instances other than those owned by
IPA which will need to be restarted upon uninstall. Clearly the PKI
ds instance does not qualify. We were generating a traceback when at
the conclusion of dsinstance.uninstall we tried to start the
remaining ds instances as indicated by the running flag, but there
were none to restart (because the running flag had been set as a
consequence of the PKI ds instance).
* We only want to restart ds instances if there are other ds instances
besides those owned by IPA. We shouldn't be stopping all ds
instances either, but that's going to be covered by another
ticket. The fix for restarting other ds instances at the end of
uninstall is to check and see if there are other ds instances
remaining after we've removed ours, if so we restart them. Also it's
irrelevant if those ds instances were not present when we installed,
it only matters if they exist after we restore things during
uninstall. If they are present we have to start them back up because
we shut them down during uninstall.
* Add new function get_ds_instances() which returns a list of existing
ds instances.
* fixed error messages that incorrectly stated it "failed to restart"
a ds instance when it should be "failed to create".
Diffstat (limited to 'ipaserver/install/cainstance.py')
-rw-r--r-- | ipaserver/install/cainstance.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py index f953100be..64175e482 100644 --- a/ipaserver/install/cainstance.py +++ b/ipaserver/install/cainstance.py @@ -292,7 +292,6 @@ class CADSInstance(service.Service): root_logger.critical("failed to add user %s" % e) def __create_instance(self): - self.backup_state("running", dsinstance.is_ds_running()) self.backup_state("serverid", self.serverid) inf_txt = ipautil.template_str(INF_TEMPLATE, self.sub_dict) @@ -310,7 +309,7 @@ class CADSInstance(service.Service): ipautil.run(args) root_logger.debug("completed creating ds instance") except ipautil.CalledProcessError, e: - root_logger.critical("failed to restart ds instance %s" % e) + root_logger.critical("failed to create ds instance %s" % e) inf_fd.close() def load_pkcs12(self): @@ -383,13 +382,9 @@ class CADSInstance(service.Service): if self.is_configured(): self.print_msg("Unconfiguring CA directory server") - running = self.restore_state("running") enabled = self.restore_state("enabled") serverid = self.restore_state("serverid") - if not running is None: - ipaservices.knownservices.dirsrv.stop(self.serverid) - if not enabled is None and not enabled: ipaservices.knownservices.dirsrv.disable() |