def write_manifest(data, manifest_name):
    """
    Write the game metadata to a YAML manifest file
    """
    path = data.get('path')
    if not path:
        raise GamePathError('No path found in game data.\nData=' +\
                            '\n'.join(['%s:\t%s' % (k, v) for k, v in data.iteritems()]))
    path = get_absolute_path(path)

    # write the YAML data
    try:
        f = open(join_path(path, manifest_name), 'w')
        try:
            yaml.dump(data, f, default_flow_style=False)
        finally:
            f.close()
    except IOError as e:
        LOG.error('Failed writing manifest: %s', str(e))
        raise GamePathError('Failed writing manifest file.')

#######################################################################################################################

# pylint: disable=R0902
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/models/game.py/write_manifest/original