Imported Upstream version 4.0.5
This commit is contained in:
@@ -24,33 +24,23 @@ import syslog
|
||||
import traceback
|
||||
from ipalib import api
|
||||
from ipaplatform import services
|
||||
from ipaplatform.paths import paths
|
||||
from ipaserver.install import certs
|
||||
|
||||
|
||||
def _main():
|
||||
def main():
|
||||
try:
|
||||
instance = sys.argv[1]
|
||||
except IndexError:
|
||||
instance = ""
|
||||
|
||||
api.bootstrap(in_server=True, context='restart', confdir=paths.ETC_IPA)
|
||||
api.bootstrap(context='restart')
|
||||
api.finalize()
|
||||
|
||||
syslog.syslog(syslog.LOG_NOTICE, "certmonger restarted dirsrv instance '%s'" % instance)
|
||||
|
||||
try:
|
||||
if services.knownservices.dirsrv.is_running():
|
||||
services.knownservices.dirsrv.restart(instance, ldapi=True)
|
||||
except Exception as e:
|
||||
services.knownservices.dirsrv.restart(instance)
|
||||
except Exception, e:
|
||||
syslog.syslog(syslog.LOG_ERR, "Cannot restart dirsrv (instance: '%s'): %s" % (instance, str(e)))
|
||||
|
||||
|
||||
def main():
|
||||
with certs.renewal_lock:
|
||||
_main()
|
||||
|
||||
|
||||
try:
|
||||
main()
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user