~tamura-yoshiaki/nova/boot-from-volume-os-api

« back to all changes in this revision

Viewing changes to nova/db/sqlalchemy/api.py

Fixed the case where an exception was thrown when trying to get a list of flavors via the api yet there were no flavors to list.

hand tested :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2944
2944
                        filter_by(deleted=False).\
2945
2945
                        order_by("name").\
2946
2946
                        all()
 
2947
    inst_dict = {}
2947
2948
    if inst_types:
2948
 
        inst_dict = {}
2949
2949
        for i in inst_types:
2950
2950
            inst_dict[i['name']] = _dict_with_extra_specs(i)
2951
 
        return inst_dict
2952
 
    else:
2953
 
        raise exception.NoInstanceTypesFound()
 
2951
    return inst_dict
2954
2952
 
2955
2953
 
2956
2954
@require_context