diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-05-29 10:37:18 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2014-06-16 19:48:19 +0200 |
commit | 49fcd42f8fd71b894a0953a37f10a6c326e16048 (patch) | |
tree | 0c1324c5a3183ce20e92af183ffefde92a77147a /install/restart_scripts | |
parent | 926f8647d2a676c1dd2e446633eb76cdf1a7bf0c (diff) | |
download | freeipa-49fcd42f8fd71b894a0953a37f10a6c326e16048.tar.gz freeipa-49fcd42f8fd71b894a0953a37f10a6c326e16048.tar.xz freeipa-49fcd42f8fd71b894a0953a37f10a6c326e16048.zip |
ipaplatform: Change service code in freeipa to use ipaplatform services
https://fedorahosted.org/freeipa/ticket/4052
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'install/restart_scripts')
-rw-r--r-- | install/restart_scripts/renew_ca_cert | 5 | ||||
-rw-r--r-- | install/restart_scripts/renew_ra_cert | 3 | ||||
-rw-r--r-- | install/restart_scripts/restart_dirsrv | 3 | ||||
-rw-r--r-- | install/restart_scripts/restart_httpd | 3 | ||||
-rw-r--r-- | install/restart_scripts/stop_pkicad | 3 |
5 files changed, 11 insertions, 6 deletions
diff --git a/install/restart_scripts/renew_ca_cert b/install/restart_scripts/renew_ca_cert index 2663887d6..550de969a 100644 --- a/install/restart_scripts/renew_ca_cert +++ b/install/restart_scripts/renew_ca_cert @@ -32,6 +32,7 @@ from ipapython import services as ipaservices from ipalib import api, errors, x509, util from ipaserver.install import certs, cainstance, installutils from ipaserver.plugins.ldap2 import ldap2 +from ipaplatform import services def main(): nickname = sys.argv[1] @@ -41,7 +42,7 @@ def main(): configured_constants = dogtag.configured_constants(api) alias_dir = configured_constants.ALIAS_DIR - dogtag_service = ipaservices.knownservices[configured_constants.SERVICE_NAME] + dogtag_service = services.knownservices[configured_constants.SERVICE_NAME] dogtag_instance = configured_constants.PKI_INSTANCE_NAME # dogtag opens its NSS database in read/write mode so we need it @@ -89,7 +90,7 @@ def main(): "Updating trust on certificate %s failed in %s" % (nickname, db.secdir)) - # Now we can start the CA. Using the ipaservices start should fire + # Now we can start the CA. Using the services start should fire # off the servlet to verify that the CA is actually up and responding so # when this returns it should be good-to-go. The CA was stopped in the # pre-save state. diff --git a/install/restart_scripts/renew_ra_cert b/install/restart_scripts/renew_ra_cert index 79bc4cf58..46367fd9c 100644 --- a/install/restart_scripts/renew_ra_cert +++ b/install/restart_scripts/renew_ra_cert @@ -27,6 +27,7 @@ import traceback from ipapython import services as ipaservices from ipalib import api from ipaserver.install import certs, cainstance +from ipaplatform import services nickname = 'ipaCert' @@ -49,7 +50,7 @@ def main(): # Now restart Apache so the new certificate is available syslog.syslog(syslog.LOG_NOTICE, "Restarting httpd") try: - ipaservices.knownservices.httpd.restart() + services.knownservices.httpd.restart() except Exception, e: syslog.syslog(syslog.LOG_ERR, "Cannot restart httpd: %s" % e) else: diff --git a/install/restart_scripts/restart_dirsrv b/install/restart_scripts/restart_dirsrv index 03e6a5c42..738bb3120 100644 --- a/install/restart_scripts/restart_dirsrv +++ b/install/restart_scripts/restart_dirsrv @@ -24,6 +24,7 @@ import syslog import traceback from ipapython import services as ipaservices from ipalib import api +from ipaplatform import services def main(): try: @@ -37,7 +38,7 @@ def main(): syslog.syslog(syslog.LOG_NOTICE, "certmonger restarted dirsrv instance '%s'" % instance) try: - ipaservices.knownservices.dirsrv.restart(instance) + services.knownservices.dirsrv.restart(instance) except Exception, e: syslog.syslog(syslog.LOG_ERR, "Cannot restart dirsrv (instance: '%s'): %s" % (instance, str(e))) diff --git a/install/restart_scripts/restart_httpd b/install/restart_scripts/restart_httpd index 98337bc85..e8ff72824 100644 --- a/install/restart_scripts/restart_httpd +++ b/install/restart_scripts/restart_httpd @@ -22,12 +22,13 @@ import syslog import traceback from ipapython import services as ipaservices +from ipaplatform import services def main(): syslog.syslog(syslog.LOG_NOTICE, 'certmonger restarted httpd') try: - ipaservices.knownservices.httpd.restart() + services.knownservices.httpd.restart() except Exception, e: syslog.syslog(syslog.LOG_ERR, "Cannot restart httpd: %s" % str(e)) diff --git a/install/restart_scripts/stop_pkicad b/install/restart_scripts/stop_pkicad index e58e04401..461baa6a5 100644 --- a/install/restart_scripts/stop_pkicad +++ b/install/restart_scripts/stop_pkicad @@ -25,13 +25,14 @@ import traceback from ipapython import services as ipaservices from ipapython import dogtag from ipalib import api +from ipaplatform import services def main(): api.bootstrap(context='restart') api.finalize() configured_constants = dogtag.configured_constants(api) - dogtag_service = ipaservices.knownservices[configured_constants.SERVICE_NAME] + dogtag_service = services.knownservices[configured_constants.SERVICE_NAME] dogtag_instance = configured_constants.PKI_INSTANCE_NAME syslog.syslog(syslog.LOG_NOTICE, "Stopping %s" % dogtag_service.service_name) |