forked from mirrors/thatmattlove-hyperglass
adjusted netmiko global_delay_factor, removed sleep functions to improve performance
This commit is contained in:
parent
d65ed753d9
commit
0edd9f22df
5 changed files with 4 additions and 2 deletions
BIN
.flask_cache/2029240f6d1128be89ddc32729463129
Normal file
BIN
.flask_cache/2029240f6d1128be89ddc32729463129
Normal file
Binary file not shown.
BIN
.flask_cache/657c533712fd34452c34b44cb9a65048
Normal file
BIN
.flask_cache/657c533712fd34452c34b44cb9a65048
Normal file
Binary file not shown.
BIN
.flask_cache/74bc75c0764cbc805c70645cef1f026b
Normal file
BIN
.flask_cache/74bc75c0764cbc805c70645cef1f026b
Normal file
Binary file not shown.
|
|
@ -116,6 +116,7 @@ def execute(lg_data):
|
||||||
"username": matchProxy(router_proxy)[1],
|
"username": matchProxy(router_proxy)[1],
|
||||||
"password": matchProxy(router_proxy)[2],
|
"password": matchProxy(router_proxy)[2],
|
||||||
"device_type": matchProxy(router_proxy)[3],
|
"device_type": matchProxy(router_proxy)[3],
|
||||||
|
"global_delay_factor": 0.5,
|
||||||
}
|
}
|
||||||
nm_connect_proxied = ConnectHandler(**nm_proxy)
|
nm_connect_proxied = ConnectHandler(**nm_proxy)
|
||||||
nm_ssh_command = matchProxy(router_proxy)[4].format(**nm_host) + "\n"
|
nm_ssh_command = matchProxy(router_proxy)[4].format(**nm_host) + "\n"
|
||||||
|
|
@ -126,12 +127,12 @@ def execute(lg_data):
|
||||||
# Accept SSH key warnings
|
# Accept SSH key warnings
|
||||||
if "Are you sure you want to continue connecting" in proxy_output:
|
if "Are you sure you want to continue connecting" in proxy_output:
|
||||||
nm_connect_proxied.write_channel("yes" + "\n")
|
nm_connect_proxied.write_channel("yes" + "\n")
|
||||||
time.sleep(1)
|
# time.sleep(1)
|
||||||
nm_connect_proxied.write_channel(nm_host["password"] + "\n")
|
nm_connect_proxied.write_channel(nm_host["password"] + "\n")
|
||||||
# Send password on prompt
|
# Send password on prompt
|
||||||
elif "assword" in proxy_output:
|
elif "assword" in proxy_output:
|
||||||
nm_connect_proxied.write_channel(nm_host["password"] + "\n")
|
nm_connect_proxied.write_channel(nm_host["password"] + "\n")
|
||||||
time.sleep(1)
|
# time.sleep(1)
|
||||||
proxy_output += nm_connect_proxied.read_channel()
|
proxy_output += nm_connect_proxied.read_channel()
|
||||||
# Reclassify netmiko connection as configured device type
|
# Reclassify netmiko connection as configured device type
|
||||||
redispatch(nm_connect_proxied, nm_host["device_type"])
|
redispatch(nm_connect_proxied, nm_host["device_type"])
|
||||||
|
|
@ -150,6 +151,7 @@ def execute(lg_data):
|
||||||
"device_type": type,
|
"device_type": type,
|
||||||
"username": returnCred(findCred(router))[0],
|
"username": returnCred(findCred(router))[0],
|
||||||
"password": returnCred(findCred(router))[1],
|
"password": returnCred(findCred(router))[1],
|
||||||
|
"global_delay_factor": 0.5,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Loop through router list, determine if proxy exists
|
# Loop through router list, determine if proxy exists
|
||||||
|
|
|
||||||
0
manage.py
Normal file → Executable file
0
manage.py
Normal file → Executable file
Loading…
Add table
Reference in a new issue