mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
Merge restart_httpd functionality to renew_ra_cert.
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
parent
2c466b79e8
commit
fac6bf30b6
@ -34,15 +34,17 @@ def main():
|
||||
api.bootstrap(context='restart')
|
||||
api.finalize()
|
||||
|
||||
# Fetch the new certificate
|
||||
db = certs.CertDB(api.env.realm)
|
||||
dercert = db.get_cert_from_db(nickname, pem=False)
|
||||
if not dercert:
|
||||
syslog.syslog(syslog.LOG_ERR, 'No certificate %s found.' % nickname)
|
||||
sys.exit(1)
|
||||
ca = cainstance.CAInstance(api.env.realm, certs.NSS_DIR)
|
||||
if ca.is_renewal_master():
|
||||
# Fetch the new certificate
|
||||
db = certs.CertDB(api.env.realm)
|
||||
dercert = db.get_cert_from_db(nickname, pem=False)
|
||||
if not dercert:
|
||||
syslog.syslog(syslog.LOG_ERR, 'No certificate %s found.' % nickname)
|
||||
sys.exit(1)
|
||||
|
||||
# Load it into dogtag
|
||||
cainstance.update_people_entry(dercert)
|
||||
# Load it into dogtag
|
||||
cainstance.update_people_entry(dercert)
|
||||
|
||||
# Now restart Apache so the new certificate is available
|
||||
syslog.syslog(syslog.LOG_NOTICE, "Restarting httpd")
|
||||
|
@ -925,7 +925,7 @@ class CAInstance(service.Service):
|
||||
pinfile='/etc/httpd/alias/pwdfile.txt',
|
||||
secdir='/etc/httpd/alias',
|
||||
pre_command=None,
|
||||
post_command='restart_httpd')
|
||||
post_command='renew_ra_cert')
|
||||
except (ipautil.CalledProcessError, RuntimeError), e:
|
||||
root_logger.error(
|
||||
"certmonger failed to start tracking certificate: %s" % str(e))
|
||||
|
Loading…
Reference in New Issue
Block a user