e3ffab
From ed5044ffc209e842c000d1c47980de6e0ab8e52a Mon Sep 17 00:00:00 2001
e3ffab
From: Jan Cholasta <jcholast@redhat.com>
e3ffab
Date: Mon, 26 Jan 2015 10:39:48 +0000
e3ffab
Subject: [PATCH] Create correct log directories during full restore in
e3ffab
 ipa-restore
e3ffab
e3ffab
https://fedorahosted.org/freeipa/ticket/4865
e3ffab
e3ffab
Reviewed-By: Martin Kosek <mkosek@redhat.com>
e3ffab
---
e3ffab
 ipaserver/install/ipa_restore.py | 29 ++++++++++++++---------------
e3ffab
 1 file changed, 14 insertions(+), 15 deletions(-)
e3ffab
e3ffab
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
e3ffab
index 562a793c2c9383d7495c84a817ac9f7a1407f9bb..6de73e640d101a72aacc7ce73a6937c222da4ebb 100644
e3ffab
--- a/ipaserver/install/ipa_restore.py
e3ffab
+++ b/ipaserver/install/ipa_restore.py
e3ffab
@@ -713,22 +713,21 @@ class Restore(admintool.AdminTool):
e3ffab
         not exist then tomcat will fail to start.
e3ffab
 
e3ffab
         The directory is different depending on whether we have a d9-based
e3ffab
-        or a d10-based installation. We can tell based on whether there is
e3ffab
-        a PKI-IPA 389-ds instance.
e3ffab
+        or a d10-based installation.
e3ffab
         """
e3ffab
-        if os.path.exists(paths.ETC_SLAPD_PKI_IPA_DIR): # dogtag 9
e3ffab
-            topdir = paths.PKI_CA_LOG_DIR
e3ffab
-            dirs = [topdir,
e3ffab
-                    '/var/log/pki-ca/signedAudit,']
e3ffab
-        else: # dogtag 10
e3ffab
-            topdir = paths.TOMCAT_TOPLEVEL_DIR
e3ffab
-            dirs = [topdir,
e3ffab
-                    paths.TOMCAT_CA_DIR,
e3ffab
-                    paths.TOMCAT_CA_ARCHIVE_DIR,
e3ffab
-                    paths.TOMCAT_SIGNEDAUDIT_DIR,]
e3ffab
-
e3ffab
-        if os.path.exists(topdir):
e3ffab
-            return
e3ffab
+        dirs = []
e3ffab
+        # dogtag 9
e3ffab
+        if (os.path.exists(paths.VAR_LIB_PKI_CA_DIR) and
e3ffab
+                not os.path.exists(paths.PKI_CA_LOG_DIR)):
e3ffab
+            dirs += [paths.PKI_CA_LOG_DIR,
e3ffab
+                     os.path.join(paths.PKI_CA_LOG_DIR, 'signedAudit')]
e3ffab
+        # dogtag 10
e3ffab
+        if (os.path.exists(paths.VAR_LIB_PKI_TOMCAT_DIR) and
e3ffab
+                not os.path.exists(paths.TOMCAT_TOPLEVEL_DIR)):
e3ffab
+            dirs += [paths.TOMCAT_TOPLEVEL_DIR,
e3ffab
+                     paths.TOMCAT_CA_DIR,
e3ffab
+                     paths.TOMCAT_CA_ARCHIVE_DIR,
e3ffab
+                     paths.TOMCAT_SIGNEDAUDIT_DIR]
e3ffab
 
e3ffab
         try:
e3ffab
             pent = pwd.getpwnam(PKI_USER)
e3ffab
-- 
e3ffab
2.1.0
e3ffab