def generate_config_file(self, file_path, config):
        """Generates the config file in the current working directory."""
        try:
            with open(file_path, 'w') as outfile:
                output = self._get_output(config)
                outfile.write(output)
        except IOError as e:
            raise CommandError('I/O error generating config file (%s): %s'
                               % (e.errno, e.strerror))

        print('Config written to %s' % file_path)
dataset/ETHPy150Open reviewboard/rbtools/rbtools/commands/setup_repo.py/SetupRepo.generate_config_file/original