summaryrefslogtreecommitdiffstats
path: root/install/restart_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'install/restart_scripts')
-rw-r--r--install/restart_scripts/renew_ra_cert20
1 files changed, 11 insertions, 9 deletions
diff --git a/install/restart_scripts/renew_ra_cert b/install/restart_scripts/renew_ra_cert
index 7dc2c57e7..79bc4cf58 100644
--- a/install/restart_scripts/renew_ra_cert
+++ b/install/restart_scripts/renew_ra_cert
@@ -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)
-
- # Load it into dogtag
- cainstance.update_people_entry(dercert)
+ 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)
# Now restart Apache so the new certificate is available
syslog.syslog(syslog.LOG_NOTICE, "Restarting httpd")