def get_keystone_project_id(project_name, cur):
    """ Get a keystone project id by name"""

    cur.execute("SELECT id FROM public.project WHERE name='%s'" %
                project_name)
    project_id = cur.fetchone()
    if project_id is not None:
        return project_id['id']
    else:
        return project_id