aa60fb
From 71809fb6071a86156f881e20d4845cbd47606862 Mon Sep 17 00:00:00 2001
aa60fb
From: David Kupka <dkupka@redhat.com>
aa60fb
Date: Wed, 16 Dec 2015 12:45:24 +0000
aa60fb
Subject: [PATCH] installer: Fix logic of reading option values from cache.
aa60fb
aa60fb
Only options explicitly set must be stored before installer exits first step
aa60fb
of external CA setup. When installer continues all stored option values must
aa60fb
be restored.
aa60fb
aa60fb
https://fedorahosted.org/freeipa/ticket/5556
aa60fb
aa60fb
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
aa60fb
---
aa60fb
 ipaserver/install/server/install.py | 7 +++----
aa60fb
 1 file changed, 3 insertions(+), 4 deletions(-)
aa60fb
aa60fb
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
aa60fb
index 71992db0d39e1969649587486031a8fb1a03419d..01dffd08d4c929ebc5ecb6e6b0a8b685c1320dbd 100644
aa60fb
--- a/ipaserver/install/server/install.py
aa60fb
+++ b/ipaserver/install/server/install.py
aa60fb
@@ -343,9 +343,7 @@ def install_check(installer):
aa60fb
             sys.exit("Directory Manager password required")
aa60fb
         try:
aa60fb
             cache_vars = read_cache(dm_password)
aa60fb
-            for name, value in cache_vars.iteritems():
aa60fb
-                if name not in options.__dict__:
aa60fb
-                    options.__dict__[name] = value
aa60fb
+            options.__dict__.update(cache_vars)
aa60fb
             if cache_vars.get('external_ca', False):
aa60fb
                 options.external_ca = False
aa60fb
                 options.interactive = False
aa60fb
@@ -767,7 +765,8 @@ def install(installer):
aa60fb
             options.host_name = host_name
aa60fb
             options.forwarders = dns.dns_forwarders
aa60fb
             options.reverse_zones = dns.reverse_zones
aa60fb
-            cache_vars = {n: getattr(options, n) for o, n in installer.knobs()}
aa60fb
+            cache_vars = {n: options.__dict__[n] for o, n in installer.knobs()
aa60fb
+                          if n in options.__dict__}
aa60fb
             write_cache(cache_vars)
aa60fb
 
aa60fb
         ca.install_step_0(False, None, options)
aa60fb
-- 
aa60fb
2.5.0
aa60fb