def array_to_dict(rows, key="openstack_id"):
    """ Convert a list of dicts into a dict based on key"""
    result = {}
    for row in rows:
        key_value = row.pop(key)
        result[key_value] = row

    return result