Skip to content

Instantly share code, notes, and snippets.

@ddutt
Created September 8, 2020 06:39
Show Gist options
  • Save ddutt/5d4efccd710cc254e4182774a6f835a9 to your computer and use it in GitHub Desktop.
Save ddutt/5d4efccd710cc254e4182774a6f835a9 to your computer and use it in GitHub Desktop.
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