Skip to content

Instantly share code, notes, and snippets.

@Zweedeend Zweedeend/
Created Jul 9, 2019

What would you like to do?
#!/usr/bin/env python3
from ncclient.manager import connect_ssh
# use unencrypted keys from ssh-agent or ~/.ssh keys, and rely on known_hosts
with connect_ssh("", username="stuart") as manager:
assert(":url" in manager.server_capabilities)
with manager.locked("running"):
# create a new checkpoint
manager.copy_config(source="running", target="file:///new_checkpoint.conf")
# load an old checkpoint
manager.copy_config(source="file:///old_checkpoint.conf", target="running")
# dispatch a command
# commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.