diff options
author | Alexander Bokovoy <abokovoy@redhat.com> | 2011-09-13 00:11:54 +0300 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-09-13 11:15:50 +0200 |
commit | bbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa (patch) | |
tree | 6bff89c2c7bddc46ae710b8587aac6164c22ad76 /install/tools/ipa-nis-manage | |
parent | 45e379d5bf94170ccce16e6e2af8c5ccc55c826b (diff) | |
download | freeipa-bbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa.tar.gz freeipa-bbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa.tar.xz freeipa-bbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa.zip |
Convert installation tools to platform-independent access to system services
http://fedorahosted.org/freeipa/ticket/1605
Diffstat (limited to 'install/tools/ipa-nis-manage')
-rwxr-xr-x | install/tools/ipa-nis-manage | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/install/tools/ipa-nis-manage b/install/tools/ipa-nis-manage index d875f96de..542736a8d 100755 --- a/install/tools/ipa-nis-manage +++ b/install/tools/ipa-nis-manage @@ -24,6 +24,7 @@ import os try: from optparse import OptionParser from ipapython import ipautil, config + from ipapython import services as ipaservices from ipaserver.install import installutils from ipaserver.install.ldapupdate import LDAPUpdate, BadSyntax from ipaserver.plugins.ldap2 import ldap2 @@ -143,15 +144,17 @@ def main(): # Enable either the portmap or rpcbind service try: - ipautil.run(["/sbin/chkconfig", "portmap", "on"]) - servicemsg = "portmap" + portmap = ipaservices.knownservices.portmap + portmap.enable() + servicemsg = portmap.service_name except ipautil.CalledProcessError, cpe: if cpe.returncode == 1: try: - ipautil.run(["/sbin/chkconfig", "rpcbind", "on"]) - servicemsg = "rpcbind" + rpcbind = ipaservices.knownservices.rpcbind + rpcbind.enable() + servicemsg = rpcbind.service_name except ipautil.CalledProcessError, cpe: - print "Unable to enable either portmap or rpcbind" + print "Unable to enable either %s or %s" % (portmap.service_name, rpcbind.service_name) retval = 3 # The cn=config entry for the plugin may already exist but it |