def get_project(conn, vm_):
    '''
    Return the project to use.
    '''
    try:
        projects = conn.ex_list_projects()
    except __HOLE__:
        # with versions <0.15 of libcloud this is causing an AttributeError.
        log.warning('Cannot get projects, you may need to update libcloud to 0.15 or later')
        return False
    projid = config.get_cloud_config_value('projectid', vm_, __opts__)

    if not projid:
        return False

    for project in projects:
        if str(projid) in (str(project.id), str(project.name)):
            return project

    log.warning("Couldn't find project {0} in projects".format(projid))
    return False
dataset/ETHPy150Open saltstack/salt/salt/cloud/clouds/cloudstack.py/get_project