From 95447911535974731a931b1d758f6cfd985c1e59 Mon Sep 17 00:00:00 2001
From: David Kupka <dkupka@redhat.com>
Date: Wed, 16 Dec 2015 12:43:13 +0000
Subject: [PATCH] installer: Propagate option values from components instead of
copying them.
https://fedorahosted.org/freeipa/ticket/5556
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
---
ipapython/install/core.py | 21 ++++++++++++++++++---
ipaserver/install/server/install.py | 25 -------------------------
ipaserver/install/server/replicainstall.py | 12 +-----------
3 files changed, 19 insertions(+), 39 deletions(-)
diff --git a/ipapython/install/core.py b/ipapython/install/core.py
index 91ae854cdb2a8846e2a2673a5bfe54b4f75f3823..3bb13267326b8cf1f22bb34dcf1e03402479446e 100644
--- a/ipapython/install/core.py
+++ b/ipapython/install/core.py
@@ -484,6 +484,21 @@ class Composite(Configurable):
for comp_cls in result:
yield comp_cls.__outer_class__, comp_cls.__outer_name__
+ def __getattr__(self, name):
+ for owner_cls, knob_name in self.knobs():
+ if knob_name == name:
+ break
+ else:
+ raise AttributeError(name)
+
+ for component in self.__components:
+ if isinstance(component, owner_cls):
+ break
+ else:
+ raise AttributeError(name)
+
+ return getattr(component, name)
+
def _reset(self):
self.__components = list(self._get_components())
@@ -501,8 +516,7 @@ class Composite(Configurable):
try:
validator.next()
except StopIteration:
- if child.done():
- self.__components.remove(child)
+ pass
else:
new_validate.append((child, validator))
if not new_validate:
@@ -516,7 +530,8 @@ class Composite(Configurable):
yield from_(super(Composite, self)._configure())
- execute = [(c, c._executor()) for c in self.__components]
+ execute = [(c, c._executor()) for c in self.__components
+ if not c.done()]
while True:
new_execute = []
for child, executor in execute:
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 9d7036a7786a35e6aa2429254d62c8afb30970db..71992db0d39e1969649587486031a8fb1a03419d 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -1592,35 +1592,10 @@ class Server(common.Installable, common.Interactive, core.Composite):
self.setup_ca = False
self.setup_kra = False
- self.external_ca = self.ca.external_ca
- self.external_ca_type = self.ca.external_ca_type
- self.external_cert_files = self.ca.external_cert_files
- self.no_pkinit = self.ca.no_pkinit
- self.dirsrv_cert_files = self.ca.dirsrv_cert_files
- self.http_cert_files = self.ca.http_cert_files
- self.pkinit_cert_files = self.ca.pkinit_cert_files
- self.dirsrv_pin = self.ca.dirsrv_pin
- self.http_pin = self.ca.http_pin
- self.pkinit_pin = self.ca.pkinit_pin
- self.dirsrv_cert_name = self.ca.dirsrv_cert_name
- self.http_cert_name = self.ca.http_cert_name
- self.pkinit_cert_name = self.ca.pkinit_cert_name
- self.ca_cert_files = self.ca.ca_cert_files
- self.subject = self.ca.subject
- self.ca_signing_algorithm = self.ca.ca_signing_algorithm
- self.setup_dns = self.dns.setup_dns
- self.forwarders = self.dns.forwarders
- self.no_forwarders = self.dns.no_forwarders
- self.reverse_zones = self.dns.reverse_zones
- self.no_reverse = self.dns.no_reverse
- self.no_dnssec_validation = self.dns.no_dnssec_validation
self.dnssec_master = False
self.disable_dnssec_master = False
self.kasp_db_file = None
self.force = False
- self.zonemgr = self.dns.zonemgr
- self.no_host_dns = self.dns.no_host_dns
- self.no_dns_sshfp = self.dns.no_dns_sshfp
self.unattended = not self.interactive
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 6e9157cabc49161ba27983cbf1de1428d1b48b7d..a5d4a77f3daa8110ad0be064085b12b20da853cf 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -847,22 +847,12 @@ class Replica(common.Installable, common.Interactive, core.Composite):
self.external_ca = False
self.external_cert_files = None
- self.no_pkinit = self.ca.no_pkinit
- self.skip_schema_check = self.ca.skip_schema_check
-
- self.setup_dns = self.dns.setup_dns
- self.forwarders = self.dns.forwarders
- self.no_forwarders = self.dns.no_forwarders
- self.reverse_zones = self.dns.reverse_zones
- self.no_reverse = self.dns.no_reverse
- self.no_dnssec_validation = self.dns.no_dnssec_validation
+
self.dnssec_master = False
self.disable_dnssec_master = False
self.kasp_db_file = None
self.force = False
self.zonemgr = None
- self.no_host_dns = self.dns.no_host_dns
- self.no_dns_sshfp = self.dns.no_dns_sshfp
self.unattended = not self.interactive
--
2.5.0