Skip to content
Snippets Groups Projects
Commit 35ba0f17 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

fix bug missing \n

parent 997e349d
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,7 @@ def start_bgp(public_ip, bgp_area):
parts = public_ip.split('.')
commands = "configure terminal"
bgp_commands = f"\nrouter bgp {bgp_area}"
bgp_index = 0
if public_ip.startswith('123.100'):
bgp_index = parts[2]
......@@ -102,7 +103,7 @@ def start_bgp(public_ip, bgp_area):
neighbor_area = "65000"
bgp_commands += f"\nneighbor {ip_peer} remote-as {neighbor_area}"
if random.random() < 1: # TODO: probability parameter
bgp_commands = f"neighbor {ip_peer} weight 500"
bgp_commands = f"\nneighbor {ip_peer} weight 500"
commands += bgp_commands
commands += "\nexit\nexit\nwrite"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment