Fixes an issue caused by the latest installer patches pushed to master.

Patch attached.

--
Martin Basti

From dab97352b07b4c71e2506fc9eb1f88b4c9c94f17 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Mon, 1 Jun 2015 13:13:17 +0200
Subject: [PATCH] Installers fix: remove temporal ccache

Environ variable may be changed outside, so store path into global
variable.
---
 ipaserver/install/server/install.py | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 61137d2e9f41aff6a74dbfc4f7a63e74b53ed7fa..aea1f9915f16a55c44183b0cebb41c04622be503 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -41,6 +41,7 @@ SYSRESTORE_DIR_PATH = paths.SYSRESTORE
 
 installation_cleanup = True
 original_ccache = None
+temp_ccache = None
 
 
 def validate_dm_password(password):
@@ -248,24 +249,28 @@ def set_subject_in_config(realm_name, dm_password, suffix, subject_base):
 
 
 def init_private_ccache():
-    (desc, path) = tempfile.mkstemp(prefix='krbcc')
+    global original_ccache
+    global temp_ccache
+
+    (desc, temp_ccache) = tempfile.mkstemp(prefix='krbcc')
     os.close(desc)
 
-    original_ccache = os.environ.get('KRB5CCNAME', None)
+    original_ccache = os.environ.get('KRB5CCNAME')
 
-    os.environ['KRB5CCNAME'] = path
+    os.environ['KRB5CCNAME'] = temp_ccache
 
 
 def destroy_private_ccache():
-    path = os.environ.get('KRB5CCNAME')
+    global original_ccache
+    global temp_ccache
 
     if original_ccache is not None:
         os.environ['KRB5CCNAME'] = original_ccache
     else:
         os.environ.pop('KRB5CCNAME', None)
 
-    if os.path.exists(path):
-        os.remove(path)
+    if os.path.exists(temp_ccache):
+        os.remove(temp_ccache)
 
 
 def common_cleanup(func):
-- 
2.1.0

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