Hi,

the attached patch fixes <https://fedorahosted.org/freeipa/ticket/4865>.

Honza

--
Jan Cholasta
>From 2cdb9f96c94c146805f43f38b5b93d48c95eecdb Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Mon, 26 Jan 2015 10:39:48 +0000
Subject: [PATCH] Create correct log directories during full restore in
 ipa-restore

https://fedorahosted.org/freeipa/ticket/4865
---
 ipaserver/install/ipa_restore.py | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index 562a793..6de73e6 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -713,22 +713,21 @@ class Restore(admintool.AdminTool):
         not exist then tomcat will fail to start.
 
         The directory is different depending on whether we have a d9-based
-        or a d10-based installation. We can tell based on whether there is
-        a PKI-IPA 389-ds instance.
+        or a d10-based installation.
         """
-        if os.path.exists(paths.ETC_SLAPD_PKI_IPA_DIR): # dogtag 9
-            topdir = paths.PKI_CA_LOG_DIR
-            dirs = [topdir,
-                    '/var/log/pki-ca/signedAudit,']
-        else: # dogtag 10
-            topdir = paths.TOMCAT_TOPLEVEL_DIR
-            dirs = [topdir,
-                    paths.TOMCAT_CA_DIR,
-                    paths.TOMCAT_CA_ARCHIVE_DIR,
-                    paths.TOMCAT_SIGNEDAUDIT_DIR,]
-
-        if os.path.exists(topdir):
-            return
+        dirs = []
+        # dogtag 9
+        if (os.path.exists(paths.VAR_LIB_PKI_CA_DIR) and
+                not os.path.exists(paths.PKI_CA_LOG_DIR)):
+            dirs += [paths.PKI_CA_LOG_DIR,
+                     os.path.join(paths.PKI_CA_LOG_DIR, 'signedAudit')]
+        # dogtag 10
+        if (os.path.exists(paths.VAR_LIB_PKI_TOMCAT_DIR) and
+                not os.path.exists(paths.TOMCAT_TOPLEVEL_DIR)):
+            dirs += [paths.TOMCAT_TOPLEVEL_DIR,
+                     paths.TOMCAT_CA_DIR,
+                     paths.TOMCAT_CA_ARCHIVE_DIR,
+                     paths.TOMCAT_SIGNEDAUDIT_DIR]
 
         try:
             pent = pwd.getpwnam(PKI_USER)
-- 
2.1.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to