summaryrefslogtreecommitdiffstats
path: root/dashboard/src/resource_inventory/idf_templater.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-05-03 18:16:41 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-05-03 18:16:41 +0000
commit8d8f6a41e73e77178274a0fa26a084bf73bfc864 (patch)
treeb760e47a701f5cc3c8713f2fa3ea9082b10645af /dashboard/src/resource_inventory/idf_templater.py
parent270af480508026b072d875568f368080629b47fc (diff)
parent8864dae63b9512835862aabbe7f288fbe3c661e0 (diff)
Merge "Implement OPNFV workflow"
Diffstat (limited to 'dashboard/src/resource_inventory/idf_templater.py')
-rw-r--r--dashboard/src/resource_inventory/idf_templater.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/dashboard/src/resource_inventory/idf_templater.py b/dashboard/src/resource_inventory/idf_templater.py
index 7cd13bb..26307e3 100644
--- a/dashboard/src/resource_inventory/idf_templater.py
+++ b/dashboard/src/resource_inventory/idf_templater.py
@@ -12,10 +12,7 @@ from django.template.loader import render_to_string
from account.models import PublicNetwork
-from resource_inventory.models import (
- OPNFVConfig,
- Vlan
-)
+from resource_inventory.models import Vlan
class IDFTemplater:
@@ -67,7 +64,7 @@ class IDFTemplater:
def get_public_net(self, booking):
public = {}
- config = OPNFVConfig.objects.get(bundle=booking.config_bundle)
+ config = booking.opnfv_config
public_role = config.networks.get(name="public")
public_vlan = Vlan.objects.filter(network=public_role.network).first()
public_network = PublicNetwork.objects.get(vlan=public_vlan.vlan_id, lab=booking.lab)
@@ -91,7 +88,7 @@ class IDFTemplater:
return net
def get_single_net_config(self, booking, net_name):
- config = OPNFVConfig.objects.get(bundle=booking.config_bundle)
+ config = booking.opnfv_config
role = config.networks.get(name=net_name)
vlan = Vlan.objects.filter(network=role.network).first()
self.networks[net_name]['vlan'] = vlan.vlan_id
@@ -127,7 +124,10 @@ class IDFTemplater:
return bridges
def get_fuel_nodes(self, booking):
- hosts = booking.resource.hosts.exclude(config__opnfvRole__name="jumphost")
+ jumphost = booking.opnfv_config.host_opnfv_config.get(
+ role__name__iexact="jumphost"
+ )
+ hosts = booking.resource.hosts.exclude(pk=jumphost.pk)
nodes = []
for host in hosts:
node = {}