Fix certmonger errors when doing a client or server uninstall.

This started with the client uninstaller returning a 1 when not installed.
There was no way to tell whether the uninstall failed or the client
simply wasn't installed which caused no end of grief with the installer.

This led to a lot of certmonger failures too, either trying to stop
tracking a non-existent cert or not handling an existing tracked
certificate.

I moved the certmonger code out of the installer and put it into the
client/server shared ipapython lib. It now tries a lot harder and smarter
to untrack a certificate.

ticket 142
This commit is contained in:
Rob Crittenden
2010-08-31 17:21:25 -04:00
parent 2e8bae590e
commit f87bd57c1d
6 changed files with 131 additions and 28 deletions

View File

@@ -493,7 +493,9 @@ class DsInstance(service.Service):
serverid = self.restore_state("serverid")
if not serverid is None:
dirname = config_dirname(serverid)
# drop the trailing / off the config_dirname so the directory
# will match what is in certmonger
dirname = config_dirname(serverid)[:-1]
dsdb = certs.CertDB(dirname)
dsdb.untrack_server_cert("Server-Cert")
erase_ds_instance_data(serverid)