def dump_config_files(base_path, files_dict):
            for router in files_dict:
                for cfgfile in files_dict[router]:
                    cfgfile_path = os.path.abspath(base_path + '/' + router + '/' + cfgfile)
                    logging.debug('Creating file %s for router %s' %(cfgfile_path, router))
                    fpath, fname = os.path.split(cfgfile_path)
                    _mkdirs(fpath)
                    fh = open(cfgfile_path, 'w')
                    fh.write(files_dict[router][cfgfile])
                    fh.close()
                    if fname == 'rules' or fname == 'postinst':
                        os.chmod(cfgfile_path, 0744)
dataset/ETHPy150Open heyaaron/openmesher/OpenMesher/plugins/makedebs/__init__.py/dump_config_files/original