diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2019-04-09 16:30:57 -0400 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2019-05-03 11:48:22 -0400 |
commit | 04b676a8bc7209b8017395dc9bb36086283ac72c (patch) | |
tree | 381f48806f6e109784ca502f584865da72bcfe11 /src/resource_inventory/idf_templater.py | |
parent | fec940b7b8d15099b8f914ce35552c59db9eb77b (diff) |
Implement OPNFV workflow
This is a counterpart to an update to network models,
and allows for configuring baremetal OPNFV and Openstack deploys
Change-Id: I0185dbfa6c9105d7e63a7e7d7dd1f5cf228a8877
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
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 = {} |