Created
September 8, 2020 06:39
-
-
Save ddutt/5d4efccd710cc254e4182774a6f835a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def scrapli_ssh(host, port=22, user='vagrant', password='vagrant'): | |
dev_connect = { | |
"host": host, | |
"auth_username": user, | |
"auth_password": password, | |
"port": port, | |
"auth_strict_key": False, | |
"transport": "asyncssh", | |
} | |
if use_sim == nxos_sim: | |
driver = AsyncNXOSDriver | |
elif use_sim == eos_sim: | |
driver = AsyncEOSDriver | |
elif use_sim == junos_sim: | |
driver = AsyncJunosDriver | |
async with driver(**dev_connect) as conn: | |
# Platform drivers will auto-magically handle disabling paging for you | |
output = await conn.send_command(command) | |
# print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment