Updated patch attached.

On Tue, Dec 8, 2015 at 8:27 AM, Martin Basti <mba...@redhat.com> wrote:

>
>
> On 08.12.2015 16:26, Gabe Alford wrote:
>
> Just to confirm:
>
> if server is installed:
>      Let's stop here and not do anything else
>
> if domain level 0:
>      check if client installed and stop here
>
> Right?
>
> yes
>
>
>
>
> On Tue, Dec 8, 2015 at 8:20 AM, Jan Cholasta <jchol...@redhat.com> wrote:
>
>> On 8.12.2015 16:17, Martin Basti wrote:
>>
>>>
>>>
>>> On 08.12.2015 16:14, Jan Cholasta wrote:
>>>
>>>> On 8.12.2015 16:09, Martin Basti wrote:
>>>>
>>>>>
>>>>>
>>>>> On 01.12.2015 14:57, Gabe Alford wrote:
>>>>>
>>>>>> Sorry guys, I forgot to add a meaningful subject to this message.
>>>>>> Ignore the previous thread start.
>>>>>>
>>>>>> ---------- Forwarded message ----------
>>>>>> From: *Gabe Alford* <redhatri...@gmail.com
>>>>>> <mailto:redhatri...@gmail.com>>
>>>>>> Date: Mon, Nov 30, 2015 at 7:31 PM
>>>>>> Subject: [PATCH 0065]
>>>>>> To: freeipa-devel <freeipa-devel@redhat.com
>>>>>> <mailto:freeipa-devel@redhat.com>>
>>>>>>
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> Patch fix for the following tickets:
>>>>>>
>>>>>> https://fedorahosted.org/freeipa/ticket/5022
>>>>>> https://fedorahosted.org/freeipa/ticket/5320
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Gabe
>>>>>>
>>>>>>
>>>>>>
>>>>>> ACK
>>>>>
>>>>
>>>> NACK, you can't install a server over an already installed client,
>>>> thus the original check is correct.
>>>>
>>>> Ahh domain level 0, right, but this check can be added before the client
>>> check.
>>>
>>
>> Yes.
>>
>> With domain level 1, this check should stay there IMO.
>>>
>>
>> Yes. It should say "IPA server is already configured" rather than "IPA
>> replica is already configured", though.
>>
>> --
>> Jan Cholasta
>>
>
>
>
From 340a1316d8a71a4a3d7246fa87d2307f34484776 Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Tue, 8 Dec 2015 08:58:56 -0700
Subject: [PATCH] ipa-replica-install prints incorrect error message when
 replica is already installed

https://fedorahosted.org/freeipa/ticket/5022
https://fedorahosted.org/freeipa/ticket/5320
---
 ipaserver/install/server/replicainstall.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 4554166752ce4e5db2a98a8f495aa061aec963e9..e3f061a171e48f060464ef8e32630c8ca394c0b8 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -31,9 +31,8 @@ from ipaserver.install import (
     bindinstance, ca, cainstance, certs, dns, dsinstance, httpinstance,
     installutils, kra, krainstance, krbinstance, memcacheinstance,
     ntpinstance, otpdinstance, custodiainstance, service)
-from ipaserver.install.installutils import create_replica_config
-from ipaserver.install.installutils import ReplicaConfig
-from ipaserver.install.installutils import load_pkcs12
+from ipaserver.install.installutils import (
+    create_replica_config, ReplicaConfig, load_pkcs12, is_ipa_configured)
 from ipaserver.install.replication import (
     ReplicationManager, replica_conn_check)
 import SSSDConfig
@@ -423,6 +422,11 @@ def install_check(installer):
 
     tasks.check_selinux_status()
 
+    if is_ipa_configured():
+        sys.exit("IPA server is already configured on this system.\n"
+                 "If you want to reinstall the IPA server, please uninstall "
+                 "it first using 'ipa-server-install --uninstall'.")
+
     client_fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
     if client_fstore.has_files():
         sys.exit("IPA client is already configured on this system.\n"
@@ -828,6 +832,11 @@ def promote_check(installer):
 
     tasks.check_selinux_status()
 
+    if is_ipa_configured():
+        sys.exit("IPA server is already configured on this system.\n"
+                 "If you want to reinstall the IPA server, please uninstall "
+                 "it first using 'ipa-server-install --uninstall'."
+
     client_fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
     if not client_fstore.has_files():
         ensure_enrolled(installer)
-- 
1.8.3.1

-- 
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