Create correct log directories during full restore in ipa-restore

https://fedorahosted.org/freeipa/ticket/4865

Reviewed-By: Martin Kosek <mkosek@redhat.com>
This commit is contained in:
Jan Cholasta 2015-01-26 10:39:48 +00:00
parent 375ab7a303
commit 275fb2dcec

View File

@ -713,22 +713,21 @@ class Restore(admintool.AdminTool):
not exist then tomcat will fail to start. not exist then tomcat will fail to start.
The directory is different depending on whether we have a d9-based 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 or a d10-based installation.
a PKI-IPA 389-ds instance.
""" """
if os.path.exists(paths.ETC_SLAPD_PKI_IPA_DIR): # dogtag 9 dirs = []
topdir = paths.PKI_CA_LOG_DIR # dogtag 9
dirs = [topdir, if (os.path.exists(paths.VAR_LIB_PKI_CA_DIR) and
'/var/log/pki-ca/signedAudit,'] not os.path.exists(paths.PKI_CA_LOG_DIR)):
else: # dogtag 10 dirs += [paths.PKI_CA_LOG_DIR,
topdir = paths.TOMCAT_TOPLEVEL_DIR os.path.join(paths.PKI_CA_LOG_DIR, 'signedAudit')]
dirs = [topdir, # dogtag 10
paths.TOMCAT_CA_DIR, if (os.path.exists(paths.VAR_LIB_PKI_TOMCAT_DIR) and
paths.TOMCAT_CA_ARCHIVE_DIR, not os.path.exists(paths.TOMCAT_TOPLEVEL_DIR)):
paths.TOMCAT_SIGNEDAUDIT_DIR,] dirs += [paths.TOMCAT_TOPLEVEL_DIR,
paths.TOMCAT_CA_DIR,
if os.path.exists(topdir): paths.TOMCAT_CA_ARCHIVE_DIR,
return paths.TOMCAT_SIGNEDAUDIT_DIR]
try: try:
pent = pwd.getpwnam(PKI_USER) pent = pwd.getpwnam(PKI_USER)