mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
53c8efe62f
commit
41b057e387
@ -602,6 +602,7 @@ class CAInstance(service.Service):
|
|||||||
'Contents of pkispawn configuration file (%s):\n%s' %
|
'Contents of pkispawn configuration file (%s):\n%s' %
|
||||||
(cfg_file, ipautil.nolog_replace(f.read(), nolog)))
|
(cfg_file, ipautil.nolog_replace(f.read(), nolog)))
|
||||||
|
|
||||||
|
self.backup_state('installed', True)
|
||||||
try:
|
try:
|
||||||
ipautil.run(args, nolog=nolog)
|
ipautil.run(args, nolog=nolog)
|
||||||
except ipautil.CalledProcessError, e:
|
except ipautil.CalledProcessError, e:
|
||||||
@ -646,6 +647,7 @@ class CAInstance(service.Service):
|
|||||||
'-redirect', 'logs=/var/log/pki-ca',
|
'-redirect', 'logs=/var/log/pki-ca',
|
||||||
'-enable_proxy'
|
'-enable_proxy'
|
||||||
]
|
]
|
||||||
|
self.backup_state('installed', True)
|
||||||
ipautil.run(args, env={'PKI_HOSTNAME':self.fqdn})
|
ipautil.run(args, env={'PKI_HOSTNAME':self.fqdn})
|
||||||
|
|
||||||
def __enable(self):
|
def __enable(self):
|
||||||
@ -1320,6 +1322,8 @@ class CAInstance(service.Service):
|
|||||||
if not enabled is None and not enabled:
|
if not enabled is None and not enabled:
|
||||||
self.disable()
|
self.disable()
|
||||||
|
|
||||||
|
# Just eat this state if it exists
|
||||||
|
installed = self.restore_state("installed")
|
||||||
try:
|
try:
|
||||||
if self.dogtag_constants.DOGTAG_VERSION >= 10:
|
if self.dogtag_constants.DOGTAG_VERSION >= 10:
|
||||||
ipautil.run([paths.PKIDESTROY, "-i",
|
ipautil.run([paths.PKIDESTROY, "-i",
|
||||||
@ -1355,9 +1359,12 @@ class CAInstance(service.Service):
|
|||||||
|
|
||||||
# remove CRL files
|
# remove CRL files
|
||||||
root_logger.info("Remove old CRL files")
|
root_logger.info("Remove old CRL files")
|
||||||
for f in get_crl_files():
|
try:
|
||||||
root_logger.debug("Remove %s", f)
|
for f in get_crl_files():
|
||||||
installutils.remove_file(f)
|
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
|
# remove CRL directory
|
||||||
root_logger.info("Remove CRL directory")
|
root_logger.info("Remove CRL directory")
|
||||||
|
Loading…
Reference in New Issue
Block a user