diff options
author | David Kupka <dkupka@redhat.com> | 2014-07-21 15:57:18 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-07-22 09:03:56 +0200 |
commit | 41b057e38757c0acf1d600245269851f532df389 (patch) | |
tree | f181329d874aecb0625bf9e2c0a3da86c77bf0ae | |
parent | 53c8efe62f5de1bd48fbdf7bef3fa31debe81de3 (diff) | |
download | freeipa-41b057e38757c0acf1d600245269851f532df389.tar.gz freeipa-41b057e38757c0acf1d600245269851f532df389.tar.xz freeipa-41b057e38757c0acf1d600245269851f532df389.zip |
Always record that pkicreate has been executed.
Record that pkicreate/pkispawn has been executed to allow cleanup even if the
installation did not finish correctly.
https://fedorahosted.org/freeipa/ticket/2796
Reviewed-By: Martin Kosek <mkosek@redhat.com>
-rw-r--r-- | ipaserver/install/cainstance.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py index b13a77d58..03aec9571 100644 --- a/ipaserver/install/cainstance.py +++ b/ipaserver/install/cainstance.py @@ -602,6 +602,7 @@ class CAInstance(service.Service): 'Contents of pkispawn configuration file (%s):\n%s' % (cfg_file, ipautil.nolog_replace(f.read(), nolog))) + self.backup_state('installed', True) try: ipautil.run(args, nolog=nolog) except ipautil.CalledProcessError, e: @@ -646,6 +647,7 @@ class CAInstance(service.Service): '-redirect', 'logs=/var/log/pki-ca', '-enable_proxy' ] + self.backup_state('installed', True) ipautil.run(args, env={'PKI_HOSTNAME':self.fqdn}) def __enable(self): @@ -1320,6 +1322,8 @@ class CAInstance(service.Service): if not enabled is None and not enabled: self.disable() + # Just eat this state if it exists + installed = self.restore_state("installed") try: if self.dogtag_constants.DOGTAG_VERSION >= 10: ipautil.run([paths.PKIDESTROY, "-i", @@ -1355,9 +1359,12 @@ class CAInstance(service.Service): # remove CRL files root_logger.info("Remove old CRL files") - for f in get_crl_files(): - root_logger.debug("Remove %s", f) - installutils.remove_file(f) + try: + for f in get_crl_files(): + root_logger.debug("Remove %s", f) + installutils.remove_file(f) + except OSError, e: + root_logger.warning("Error while removing old CRL files: %s" % e) # remove CRL directory root_logger.info("Remove CRL directory") |