Skip to content

Commit 382e30f

Browse files
authored
Automation Toolkit Release v10.2
1 parent 5a12e2d commit 382e30f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

cd3_automation_toolkit/Network/BaseNetwork/modify_routerules_tf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -462,27 +462,26 @@ def generate_route_table_string(region_rt_name,region,routetableStr,tempStr,comm
462462
obj_tf_name = commonTools.check_tf_variable(obj_tf_name)
463463
else:
464464
obj_tf_name = dest_objs[1].strip()
465-
if ('privateip' in dest_objs[0].lower().strip()):
466-
tempdict = {'resource': 'IP', 'network_entity_id': dest_objs[0].lower().strip()}
467-
tempStr.update(tempdict)
468-
elif ('ngw' in dest_objs[0].lower().strip()):
465+
if (dest_objs[0].lower().strip().startswith('ngw')):
469466
tempdict = {'resource' : 'NGW','network_entity_id': obj_tf_name }
470467
tempStr.update(tempdict)
471-
elif ('sgw' in dest_objs[0].lower().strip()):
468+
elif (dest_objs[0].lower().strip().startswith('sgw')):
472469
tempdict = {'resource': 'SGW','network_entity_id': obj_tf_name}
473470
tempStr.update(tempdict)
474-
elif ('igw' in dest_objs[0].lower().strip()):
471+
elif (dest_objs[0].lower().strip().startswith('igw')):
475472
tempdict = {'resource': 'IGW','network_entity_id': obj_tf_name}
476473
tempStr.update(tempdict)
477-
elif ('lpg' in dest_objs[0].lower().strip()):
474+
elif (dest_objs[0].lower().strip().startswith('lpg')):
478475
tempdict = {'resource': 'LPG','network_entity_id': obj_tf_name}
479476
tempStr.update(tempdict)
480-
elif ('drg' in dest_objs[0].lower().strip()):
477+
elif (dest_objs[0].lower().strip().startswith('drg')):
481478
# dest_obj = "${oci_core_drg." + vcn_tf_name+"_"+obj_tf_name + ".id}"
482479
dest_obj = commonTools.check_tf_variable(dest_objs[1].strip())
483480
tempdict = {'resource': 'DRG','network_entity_id': dest_obj}
484481
tempStr.update(tempdict)
485-
482+
elif('privateip' in dest_objs[0].lower().strip()):
483+
tempdict = {'resource': 'IP','network_entity_id': dest_objs[0].lower().strip() }
484+
tempStr.update(tempdict)
486485
else:
487486
tempStr.update({'network_entity_id' : ''})
488487

0 commit comments

Comments
 (0)