@staticmethod<EOL><INDENT>def _rewrite_paths_in_file(config_file, paths_to_replace):<DEDENT>
lines = []<EOL>import shutil<EOL>shutil.copyfile(config_file, str(config_file + '<STR_LIT>'))<EOL>with open(config_file) as infile:<EOL><INDENT>for line in infile:<EOL><INDENT>for old_path in paths_to_replace:<EOL><INDENT>if old_path in line:<EOL><INDENT>new_path = os.path.split(old_path)[-<NUM_LIT:1>]<EOL>line = line.replace(old_path, new_path)<EOL>logger.debug("<STR_LIT>".format(old_path, new_path, config_file))<EOL><DEDENT><DEDENT>lines.append(line)<EOL><DEDENT><DEDENT>with open(config_file, '<STR_LIT:w>') as outfile:<EOL><INDENT>for line in lines:<EOL><INDENT>outfile.write(line)<EOL><DEDENT><DEDENT>
Rewrite paths in config files to match convention job_xxxx/symlink
Requires path to run_xxxx/input/config_file and a list of paths_to_replace