On 28.7.2016 16:39, Jan Cholasta wrote:
> On 25.7.2016 16:36, Petr Spacek wrote:
>> On 25.7.2016 16:16, Jan Cholasta wrote:
>>> On 25.7.2016 15:55, Petr Spacek wrote:
>>>> Hello,
>>>>
>>>> replica-install: Fix --domain
>>>>
>>>> Replica installation must not check existence of --domain - the domain
>>>> must (logically) exist.
>>>>
>>>> https://fedorahosted.org/freeipa/ticket/6130
>>>
>>> Note that Server.domain_name is already defined on line 1204 in
>>> ipaserver/install/server/install.py.
>>
>> My bad, here is updated patch.
> 
> Please use the original domain_name definition in Server, the order of knobs
> in the class matters.

Ah, the order in class is re-used for ordering in --help.

Given that --domain option depends on setup_dns which is defined before, I had
to move realm option down so realm & domain are next to each other.

-- 
Petr^2 Spacek
From c004859ac400446c5c7c18d0a96c94086c04820d Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Mon, 25 Jul 2016 15:54:43 +0200
Subject: [PATCH] replica-install: Fix --domain

Replica installation must not check existence of --domain - the domain
must (logically) exist.

https://fedorahosted.org/freeipa/ticket/6130
---
 ipaserver/install/server/common.py  |  5 -----
 ipaserver/install/server/install.py | 14 +++++++++++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/ipaserver/install/server/common.py b/ipaserver/install/server/common.py
index 45fb2dc17976a08acab16783584524721411fb4e..e6093d15cd1067a83ed89945c4a9c983c66ec06f 100644
--- a/ipaserver/install/server/common.py
+++ b/ipaserver/install/server/common.py
@@ -284,11 +284,6 @@ class BaseServer(common.Installable, common.Interactive, core.Composite):
     @domain_name.validator
     def domain_name(self, value):
         validate_domain_name(value)
-        if (self.setup_dns and
-                not self.dns.allow_zone_overlap):  # pylint: disable=no-member
-            print("Checking DNS domain %s, please wait ..." % value)
-            check_zone_overlap(value, False)
-
 
     dm_password = Knob(
         str, None,
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 7fdc2516b28d24e62266afcc0f2222c94f3ca917..a551c687b2c9e9ae743632cc7d2d15298a029977 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -17,6 +17,7 @@ import six
 
 from ipapython import certmonger, ipaldap, ipautil, sysrestore
 from ipapython.dn import DN
+from ipapython.dnsutil import check_zone_overlap
 from ipapython.install import core
 from ipapython.install.common import step
 from ipapython.install.core import Knob
@@ -1196,13 +1197,20 @@ class ServerCA(BaseServerCA):
 
 
 class Server(BaseServer):
-    realm_name = Knob(BaseServer.realm_name)
-    domain_name = Knob(BaseServer.domain_name)
-
     setup_ca = None
     setup_kra = None
     setup_dns = Knob(BaseServer.setup_dns)
 
+    realm_name = Knob(BaseServer.realm_name)
+    domain_name = Knob(BaseServer.domain_name)
+
+    @domain_name.validator
+    def domain_name(self, value):
+        if (self.setup_dns and
+                not self.dns.allow_zone_overlap):  # pylint: disable=no-member
+            print("Checking DNS domain %s, please wait ..." % value)
+            check_zone_overlap(value, False)
+
     dm_password = Knob(
         BaseServer.dm_password,
         description="Directory Manager password",
-- 
2.7.4

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