ucloud-setup/app/ceph.py

16 lines
394 B
Python
Raw Normal View History

2019-08-29 12:23:54 +00:00
import click
import os
import subprocess
@click.group()
def ceph():
pass
@ceph.command("setup")
@click.option("--ceph_url", required=True)
@click.option("--ssh_username", required=True)
def setup(ceph_url, ssh_username):
2019-08-29 12:26:25 +00:00
os.makedirs("/etc/ceph", exist_ok=True)
2019-08-29 12:23:54 +00:00
command = f"sftp -b ./ceph_batch_cmd {ssh_username}@{ceph_url}:/etc/ceph"
subprocess.check_output(command.split())