Hello,

Fix for https://fedorahosted.org/freeipa/ticket/5857

Thanks,

Gabe
From 950da9c812a162569379bd9e530977960e9ab7ca Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Tue, 3 May 2016 21:33:33 -0600
Subject: [PATCH] ipa-nis-manage enable: change service name from 'portmap' to
 'rpcbind'

https://fedorahosted.org/freeipa/ticket/5857
---
 install/tools/ipa-nis-manage | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/install/tools/ipa-nis-manage b/install/tools/ipa-nis-manage
index 3aa1507b205eaa679edebda2a3705b494369abc3..948aa0046b6eeb0f68dd90390eaca6d5b6c8dba3 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.
-- 
2.5.5

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to