diff options
author | 2019-05-03 18:16:41 +0000 | |
---|---|---|
committer | 2019-05-03 18:16:41 +0000 | |
commit | dc690ef43cc7af006c0900e8eaf1635141f0a2a1 (patch) | |
tree | 08ba81054bbd2fb10460fad7b03b36d59f386ff9 /src/resource_inventory/idf_templater.py | |
parent | 2fec9e57b50fee61e896f820d28aa363982413e9 (diff) | |
parent | 04b676a8bc7209b8017395dc9bb36086283ac72c (diff) |
Merge "Implement OPNFV workflow"
Diffstat (limited to 'src/resource_inventory/idf_templater.py')
-rw-r--r-- | src/resource_inventory/idf_templater.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/resource_inventory/idf_templater.py b/src/resource_inventory/idf_templater.py index 7cd13bb..26307e3 100644 --- a/src/resource_inventory/idf_templater.py +++ b/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 = {} |