This commit is contained in:
ahmadbilalkhalid 2019-08-29 16:44:24 +05:00
commit bb2ead7ace
4 changed files with 10 additions and 23 deletions

View file

@ -1,21 +0,0 @@
import click
import pysftp
@click.group()
def ceph():
pass
@ceph.command("setup")
@click.option("--ceph_url", required=True)
@click.option("--ssh_username", required=True)
@click.option("--ssh_key_path", required=True, help="For Example, ~/.ssh/id_rsa")
def setup(ceph_url, ssh_username, ssh_key_path):
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None # disable host key checking.
with pysftp.Connection(host=ceph_url, username=ssh_username,
private_key=ssh_key_path,
cnopts=cnopts) as sftp:
sftp.get_r('/etc/ceph', '/etc/ceph', preserve_mtime=True)