summaryrefslogtreecommitdiffstats
path: root/sdnvpn/lib/openstack_utils.py
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-05-08 17:24:10 +0200
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-05-08 17:24:10 +0200
commit8ed9f216d4bee43cc214d73377b5d8291bfb9e8c (patch)
treee70be7264ca5a045afb958661615301e3a23cd33 /sdnvpn/lib/openstack_utils.py
parent9df57f96b44d41c98a556a790dfa7f96b8dc9808 (diff)
SDNVPN-99 NAT doesn't seem to work
Currently ODL is not able to accomodate both network and router in a BGPVPN instance (https://jira.opendaylight.org/browse/NETVIRT-932 - see the comment section). So until the fix is available, testing NAT functionality using router without bgpvpn instance across subnets. Change-Id: I6bedfc8e818ddd542036a87245caf4949152d66f Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Diffstat (limited to 'sdnvpn/lib/openstack_utils.py')
-rw-r--r--sdnvpn/lib/openstack_utils.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/sdnvpn/lib/openstack_utils.py b/sdnvpn/lib/openstack_utils.py
index 990fa7c..447e87b 100644
--- a/sdnvpn/lib/openstack_utils.py
+++ b/sdnvpn/lib/openstack_utils.py
@@ -877,38 +877,38 @@ def create_network_full(neutron_client,
logger.info("A network with name '%s' already exists..." % net_name)
else:
neutron_client.format = 'json'
- logger.info('Creating neutron network %s...' % net_name)
- network_id = create_neutron_net(neutron_client, net_name)
+ logger.info('Creating neutron network %s...' % net_name)
+ if network_id == '':
+ network_id = create_neutron_net(neutron_client, net_name)
if not network_id:
return False
-
logger.debug("Network '%s' created successfully" % network_id)
+
logger.debug('Creating Subnet....')
- subnet_id = create_neutron_subnet(neutron_client, subnet_name,
- cidr, network_id, dns)
+ if subnet_id == '':
+ subnet_id = create_neutron_subnet(neutron_client, subnet_name,
+ cidr, network_id, dns)
if not subnet_id:
return None
-
logger.debug("Subnet '%s' created successfully" % subnet_id)
- logger.debug('Creating Router...')
- router_id = create_neutron_router(neutron_client, router_name)
+ logger.debug('Creating Router...')
+ if router_id == '':
+ router_id = create_neutron_router(neutron_client, router_name)
if not router_id:
return None
-
logger.debug("Router '%s' created successfully" % router_id)
+
logger.debug('Adding router to subnet...')
if not add_interface_router(neutron_client, router_id, subnet_id):
return None
-
logger.debug("Interface added successfully.")
logger.debug('Adding gateway to router...')
if not add_gateway_router(neutron_client, router_id):
return None
-
logger.debug("Gateway added successfully.")
network_dic = {'net_id': network_id,