The --force option may be misused to reinstall an existing IPA
client. This is not supported and may lead to unexpected errors.
When required, the cleanest way to re-install IPA client is to
run uninstall and then install again.

This patch also includes few cosmetic changes in "LDAP" term case
to provide more consistent experience with the script.

https://fedorahosted.org/freeipa/ticket/1117

>From e12f2a27f6c5f1be26fb26ed307130e2cf6838e8 Mon Sep 17 00:00:00 2001
From: Martin Kosek <mko...@redhat.com>
Date: Wed, 27 Apr 2011 16:09:43 +0200
Subject: [PATCH] Forbid reinstallation in ipa-client-install

The --force option may be misused to reinstall an existing IPA
client. This is not supported and may lead to unexpected errors.
When required, the cleanest way to re-install IPA client is to
run uninstall and then install again.

This patch also includes few cosmetic changes in "LDAP" term case
to provide more consistent experience with the script.

https://fedorahosted.org/freeipa/ticket/1117
---
 ipa-client/ipa-install/ipa-client-install |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index ca96e86f53de5f9b6d22731544c00b357eec2f4e..476afd00dac642a448c9c2064514fecbae9f31de 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -58,7 +58,7 @@ def parse_options():
     parser.add_option("--server", dest="server", help="IPA server")
     parser.add_option("--realm", dest="realm_name", help="realm name")
     parser.add_option("-f", "--force", dest="force", action="store_true",
-                      default=False, help="force setting of ldap/kerberos conf")
+                      default=False, help="force setting of LDAP/Kerberos conf")
     parser.add_option("-d", "--debug", dest="debug", action="store_true",
                       default=False, help="print debugging information")
     parser.add_option("-U", "--unattended", dest="unattended",
@@ -185,7 +185,7 @@ def chkconfig(name, status):
 
 def uninstall(options, env):
 
-    if not fstore.has_files() and not options.force:
+    if not fstore.has_files():
         print "IPA client is not configured on this system."
         return 2
 
@@ -265,11 +265,11 @@ def uninstall(options, env):
     except:
         print "Failed to clean up /etc/krb5.keytab"
 
-    print "Disabling client Kerberos and Ldap configurations"
+    print "Disabling client Kerberos and LDAP configurations"
     try:
         run(["/usr/sbin/authconfig", "--disableldap", "--disablekrb5", "--disablesssd", "--disablesssdauth", "--disablemkhomedir", "--update"])
     except Exception, e:
-        print "Failed to remove krb5/ldap configuration. " +str(e)
+        print "Failed to remove krb5/LDAP configuration. " +str(e)
         sys.exit(1)
 
     print "Restoring client configuration files"
@@ -563,7 +563,7 @@ def configure_sssd_conf(fstore, cli_realm, cli_domain, cli_server, options):
     return 0
 
 def resolve_ipaddress(server):
-    """ Connect to the server's ldap port in order to determine what ip
+    """ Connect to the server's LDAP port in order to determine what ip
         address this machine uses as "public" ip (relative to the server).
     """
 
@@ -672,7 +672,7 @@ def main():
     if options.uninstall:
         return uninstall(options, env)
 
-    if fstore.has_files() and not options.force:
+    if fstore.has_files():
         sys.exit("IPA client is already configured on this system.")
 
     cli_domain = None
-- 
1.7.4.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to