summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabe <redhatrises@gmail.com>2016-05-03 21:33:33 -0600
committerMartin Basti <mbasti@redhat.com>2016-05-10 16:30:03 +0200
commitbede6c282e6d321c348dc2d33c6d1f9c14093a57 (patch)
treea486cc91c55a41149d2acc750936d2ec11264601
parent865935739a37bb7c098f8379871648e776e582f2 (diff)
downloadfreeipa-bede6c282e6d321c348dc2d33c6d1f9c14093a57.tar.gz
freeipa-bede6c282e6d321c348dc2d33c6d1f9c14093a57.tar.xz
freeipa-bede6c282e6d321c348dc2d33c6d1f9c14093a57.zip
ipa-nis-manage enable: change service name from 'portmap' to 'rpcbind'
https://fedorahosted.org/freeipa/ticket/5857 Reviewed-By: Abhijeet Kasurde <akasurde@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
-rwxr-xr-xinstall/tools/ipa-nis-manage21
1 files changed, 10 insertions, 11 deletions
diff --git a/install/tools/ipa-nis-manage b/install/tools/ipa-nis-manage
index 3aa1507b2..948aa0046 100755
--- a/install/tools/ipa-nis-manage
+++ b/install/tools/ipa-nis-manage
@@ -144,19 +144,18 @@ def main():
retval = 1
# Enable either the portmap or rpcbind service
- try:
- portmap = services.knownservices.portmap
+ portmap = services.knownservices.portmap
+ rpcbind = services.knownservices.rpcbind
+
+ if portmap.is_installed():
portmap.enable()
servicemsg = portmap.service_name
- except ipautil.CalledProcessError as cpe:
- if cpe.returncode == 1:
- try:
- rpcbind = services.knownservices.rpcbind
- rpcbind.enable()
- servicemsg = rpcbind.service_name
- except ipautil.CalledProcessError as cpe:
- print("Unable to enable either %s or %s" % (portmap.service_name, rpcbind.service_name))
- retval = 3
+ elif rpcbind.is_installed():
+ rpcbind.enable()
+ servicemsg = rpcbind.service_name
+ else:
+ 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
# could be turned off, handle both cases.