hosting order: Add price to vm context

This commit is contained in:
M.Ravi 2017-10-02 23:17:37 +02:00
parent b848841337
commit 44b5d9bb3a

View file

@ -686,6 +686,11 @@ class OrdersHostingDetailView(LoginRequiredMixin,
context['vm'] = vm_detail.__dict__ context['vm'] = vm_detail.__dict__
context['vm']['name'] = '{}-{}'.format( context['vm']['name'] = '{}-{}'.format(
context['vm']['configuration'], context['vm']['vm_id']) context['vm']['configuration'], context['vm']['vm_id'])
context['vm']['price'] = get_vm_price(
cpu=context['vm']['cores'],
disk_size=context['vm']['disk_size'],
memory=context['vm']['memory']
)
except VMDetail.DoesNotExist: except VMDetail.DoesNotExist:
try: try:
manager = OpenNebulaManager( manager = OpenNebulaManager(