Skip to content
Snippets Groups Projects
Commit 32d9dca0 authored by Yang Yuechun's avatar Yang Yuechun
Browse files

telnet and hostname bug

parent 9264d2df
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -68,8 +68,13 @@ def create_node(project_id, name, node_type):
f = open('startup_config.cfg', 'r')
config_data = f.read()
f.close()
word = 'hostname R'
start_index = config_data.find(word)
end_index = start_index + len(word)
config_data_final = config_data[:end_index]+str(name)+config_data[end_index:]
f = open(dym_path+str(node_id)+'/configs/i'+str(name)+'_startup-config.cfg', 'w')
f.write(config_data)
f.write(config_data_final)
# print(config_data_final)
f.close()
return data
......
......@@ -69,6 +69,7 @@ while 1:
data = str('incorrect index')+str('END')
elif index[:2] == '05':
nodes_info = gn.update_nodes_info()
node_idx_1 = int(index[2:4])
node_idx_2 = int(index[4:6])
port_name_1 = index[6:10]
......
......@@ -7,7 +7,7 @@ service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
hostname R
!
ip cef
no ip domain-lookup
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment