From e9a0c8f22ee4710a3b8866ba28b0c6aa119b7d87 Mon Sep 17 00:00:00 2001 From: xaellia Date: Thu, 4 Aug 2016 15:51:26 +1000 Subject: [PATCH 4/5] Ticket 48949 - added copying slapd-collations.conf Bug Description: During the install, we missed copying slapd-collations.conf to the target install. Fix Description: Add slapd-collations to the copy list. https://fedorahosted.org/389/ticket/48949 Author: xaellia Review by: wibrown --- lib389/tools.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib389/tools.py b/lib389/tools.py index ab0af9d..5397d91 100644 --- a/lib389/tools.py +++ b/lib389/tools.py @@ -1502,7 +1502,12 @@ class SetupDs(object): # Copy correct data to the paths. # Copy in the schema # This is a little fragile, make it better. - shutil.copytree("%s/dirsrv/schema" % slapd['sysconf_dir'], slapd['schema_dir']) + shutil.copytree(os.path.join(slapd['sysconf_dir'], 'dirsrv', 'schema'), slapd['schema_dir']) + os.chown(slapd['schema_dir'], slapd['user_uid'], slapd['group_gid']) + + srcfile = os.path.join(slapd['sysconf_dir'], 'dirsrv', 'config', 'slapd-collations.conf') + dstfile = os.path.join(slapd['config_dir'], 'slapd-collations.conf') + shutil.copy2(srcfile, dstfile) os.chown(slapd['schema_dir'], slapd['user_uid'], slapd['group_gid']) # Selinux fixups? @@ -1521,11 +1526,11 @@ class SetupDs(object): if self.verbose: log.info("ACTION: Creating dse.ldif") dse = "" - with open("%s/dirsrv/data/template-dse.ldif" % slapd['data_dir']) as template_dse: + with open(os.path.join(slapd['data_dir'], 'dirsrv', 'data', 'template-dse.ldif')) as template_dse: for line in template_dse.readlines(): dse += line.replace('%', '{', 1).replace('%', '}', 1) - with open("%s/dse.ldif" % slapd['config_dir'], 'w') as file_dse: + with open(os.path.join(slapd['config_dir'], 'dse.ldif'), 'w') as file_dse: file_dse.write(dse.format( schema_dir=slapd['schema_dir'], lock_dir=slapd['lock_dir'], -- 1.8.3.1