summaryrefslogtreecommitdiffstats
path: root/install/tools
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-05-29 10:37:18 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-06-16 19:48:19 +0200
commit49fcd42f8fd71b894a0953a37f10a6c326e16048 (patch)
tree0c1324c5a3183ce20e92af183ffefde92a77147a /install/tools
parent926f8647d2a676c1dd2e446633eb76cdf1a7bf0c (diff)
downloadfreeipa-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/tools')
-rwxr-xr-xinstall/tools/ipa-ca-install3
-rwxr-xr-xinstall/tools/ipa-nis-manage5
-rwxr-xr-xinstall/tools/ipa-replica-install5
-rwxr-xr-xinstall/tools/ipa-server-install7
-rwxr-xr-xinstall/tools/ipactl25
5 files changed, 25 insertions, 20 deletions
diff --git a/install/tools/ipa-ca-install b/install/tools/ipa-ca-install
index 18c81dc1f..630c83815 100755
--- a/install/tools/ipa-ca-install
+++ b/install/tools/ipa-ca-install
@@ -40,6 +40,7 @@ from ipapython.config import IPAOptionParser
from ipapython import sysrestore
from ipapython import dogtag
from ipapython.ipa_log_manager import *
+from ipaplatform import services
log_file_name = "/var/log/ipareplica-ca-install.log"
REPLICA_INFO_TOP_DIR = None
@@ -190,7 +191,7 @@ def main():
install_dns_records(config, options)
# We need to restart apache as we drop a new config file in there
- ipaservices.knownservices.httpd.restart(capture_output=True)
+ services.knownservices.httpd.restart(capture_output=True)
#update dogtag version in config file
try:
diff --git a/install/tools/ipa-nis-manage b/install/tools/ipa-nis-manage
index 229b6b02d..b37cd6594 100755
--- a/install/tools/ipa-nis-manage
+++ b/install/tools/ipa-nis-manage
@@ -31,6 +31,7 @@ try:
from ipalib import api, errors
from ipapython.ipa_log_manager import *
from ipapython.dn import DN
+ from ipaplatform import services
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -142,13 +143,13 @@ def main():
# Enable either the portmap or rpcbind service
try:
- portmap = ipaservices.knownservices.portmap
+ portmap = services.knownservices.portmap
portmap.enable()
servicemsg = portmap.service_name
except ipautil.CalledProcessError, cpe:
if cpe.returncode == 1:
try:
- rpcbind = ipaservices.knownservices.rpcbind
+ rpcbind = services.knownservices.rpcbind
rpcbind.enable()
servicemsg = rpcbind.service_name
except ipautil.CalledProcessError, cpe:
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install
index 9452c6fcb..1c0488e5f 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -52,6 +52,7 @@ from ipapython import dogtag
from ipapython.dn import DN
import ipaclient.ntpconf
from ipaplatform import tasks
+from ipaplatform import services
log_file_name = "/var/log/ipareplica-install.log"
REPLICA_INFO_TOP_DIR = None
@@ -698,7 +699,7 @@ def main():
CA.configure_certmonger_renewal()
CA.import_ra_cert(dir + "/ra.p12")
CA.fix_ra_perms()
- ipaservices.knownservices.httpd.restart()
+ services.knownservices.httpd.restart()
# The DS instance is created before the keytab, add the SSL cert we
# generated
@@ -748,7 +749,7 @@ def main():
ds.replica_populate()
#Everything installed properly, activate ipa service.
- ipaservices.knownservices.ipa.enable()
+ services.knownservices.ipa.enable()
fail_message = '''
Your system may be partly configured.
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 00614b64e..19a0bab94 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -79,6 +79,7 @@ from ipapython.dn import DN
import ipaclient.ntpconf
from ipaplatform import tasks
+from ipaplatform import services
uninstalling = False
installation_cleanup = True
@@ -521,7 +522,7 @@ def uninstall():
group_exists = sstore.restore_state("install", "group_exists")
- ipaservices.knownservices.ipa.disable()
+ services.knownservices.ipa.disable()
ipautil.restore_hostname(sstore)
@@ -1218,7 +1219,7 @@ def main():
#Everything installed properly, activate ipa service.
- ipaservices.knownservices.ipa.enable()
+ services.knownservices.ipa.enable()
print "=============================================================================="
print "Setup complete"
@@ -1242,7 +1243,7 @@ def main():
print "\t This ticket will allow you to use the IPA tools (e.g., ipa user-add)"
print "\t and the web user interface."
- if not ipaservices.knownservices.ntpd.is_running():
+ if not services.knownservices.ntpd.is_running():
print "\t3. Kerberos requires time synchronization between clients"
print "\t and servers for correct operation. You should consider enabling ntpd."
diff --git a/install/tools/ipactl b/install/tools/ipactl
index 77e6ebd7e..581aacc36 100755
--- a/install/tools/ipactl
+++ b/install/tools/ipactl
@@ -34,6 +34,7 @@ from ipapython import services as ipaservices
from ipapython import config, dogtag
from ipaplatform import tasks
from ipapython.dn import DN
+from ipaplatform import services
class IpactlError(ScriptError):
pass
@@ -196,7 +197,7 @@ def get_config_from_file():
def stop_services(svc_list):
for svc in svc_list:
- svc_off = ipaservices.service(svc)
+ svc_off = services.service(svc)
try:
svc_off.stop(capture_output=False)
except Exception:
@@ -222,7 +223,7 @@ def ipa_start(options):
# service file again
os.unlink(ipaservices.SVC_LIST_FILE)
- dirsrv = ipaservices.knownservices.dirsrv
+ dirsrv = services.knownservices.dirsrv
try:
print "Starting Directory Service"
dirsrv.start(capture_output=get_capture_output('dirsrv', options.debug))
@@ -250,7 +251,7 @@ def ipa_start(options):
return
for svc in svc_list:
- svchandle = ipaservices.service(svc)
+ svchandle = services.service(svc)
try:
print "Starting %s Service" % svc
svchandle.start(capture_output=get_capture_output(svc, options.debug))
@@ -268,7 +269,7 @@ def ipa_start(options):
raise IpactlError("Aborting ipactl")
def ipa_stop(options):
- dirsrv = ipaservices.knownservices.dirsrv
+ dirsrv = services.knownservices.dirsrv
try:
svc_list = get_config_from_file()
except Exception, e:
@@ -293,7 +294,7 @@ def ipa_stop(options):
raise IpactlError("Failed to stop Directory Service")
for svc in reversed(svc_list):
- svchandle = ipaservices.service(svc)
+ svchandle = services.service(svc)
try:
print "Stopping %s Service" % svc
svchandle.stop(capture_output=False)
@@ -308,7 +309,7 @@ def ipa_stop(options):
def ipa_restart(options):
- dirsrv = ipaservices.knownservices.dirsrv
+ dirsrv = services.knownservices.dirsrv
new_svc_list = []
dirsrv_restart = True
if not dirsrv.is_running():
@@ -359,7 +360,7 @@ def ipa_restart(options):
if len(old_svc_list) != 0:
# we need to definitely stop some services
for svc in reversed(old_svc_list):
- svchandle = ipaservices.service(svc)
+ svchandle = services.service(svc)
try:
print "Stopping %s Service" % svc
svchandle.stop(capture_output=False)
@@ -384,7 +385,7 @@ def ipa_restart(options):
# there are services to restart
for svc in svc_list:
- svchandle = ipaservices.service(svc)
+ svchandle = services.service(svc)
try:
print "Restarting %s Service" % svc
svchandle.restart(capture_output=get_capture_output(svc, options.debug))
@@ -404,7 +405,7 @@ def ipa_restart(options):
if len(new_svc_list) != 0:
# we still need to start some services
for svc in new_svc_list:
- svchandle = ipaservices.service(svc)
+ svchandle = services.service(svc)
try:
print "Starting %s Service" % svc
svchandle.start(capture_output=get_capture_output(svc, options.debug))
@@ -424,7 +425,7 @@ def ipa_restart(options):
def ipa_status(options):
try:
- dirsrv = ipaservices.knownservices.dirsrv
+ dirsrv = services.knownservices.dirsrv
if dirsrv.is_running():
svc_list = get_config(dirsrv)
else:
@@ -437,7 +438,7 @@ def ipa_status(options):
except Exception, e:
raise IpactlError("Failed to get list of services to probe status: " + str(e))
- dirsrv = ipaservices.knownservices.dirsrv
+ dirsrv = services.knownservices.dirsrv
try:
if dirsrv.is_running():
print "Directory Service: RUNNING"
@@ -453,7 +454,7 @@ def ipa_status(options):
return
for svc in svc_list:
- svchandle = ipaservices.service(svc)
+ svchandle = services.service(svc)
try:
if svchandle.is_running():
print "%s Service: RUNNING" % svc