Skip to content
Snippets Groups Projects
Commit f19c1a52 authored by Giuseppe Attardi's avatar Giuseppe Attardi
Browse files

Update views.py

parent cf964f23
No related branches found
No related tags found
No related merge requests found
......@@ -157,8 +157,8 @@ class IndexView(tables.DataTableView):
def get_price(self, resource, request, db_session):
if resource['type'] == 'instance':
flavor_name = resource.get('flavor_name', None)
if not flavor_name: flavor_name = api.nova.flavor_get(request, resource['flavor_id']).name
flavor_name = resource.get('flavor_name',
api.nova.flavor_get(request, resource['flavor_id']).name)
flavor = db_session.query(Flavor).filter(Flavor.name == flavor_name).first()
row_list = db_session.query(Price).filter(Price.resource == flavor.id, Price.type == 'flavor').all()
elif resource['type'] == 'volume':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment