From f784e50dd95259b0a6fc9085b263dc785d8f763f Mon Sep 17 00:00:00 2001 From: Ahmed Bilal Khalid Date: Wed, 28 Aug 2019 21:07:08 +0500 Subject: [PATCH] a --- _not_working_etcd.sh | 2 +- app/scheduler.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/_not_working_etcd.sh b/_not_working_etcd.sh index 1317934..af0360e 100644 --- a/_not_working_etcd.sh +++ b/_not_working_etcd.sh @@ -35,5 +35,5 @@ rc-update add etcd etcdctl --endpoints http://$1:2379 user add root:$2 -etcdctl --endpoints http://$1:2379 user grant root --roles root +etcdctl --endpoints http://$1:2379 user grant-role root root etcdctl --endpoints http://$1:2379 auth enable diff --git a/app/scheduler.py b/app/scheduler.py index 1955ac1..7c154f8 100644 --- a/app/scheduler.py +++ b/app/scheduler.py @@ -1,6 +1,7 @@ import click import subprocess import os +import shutil from app.helper import ( clone, @@ -22,9 +23,9 @@ def scheduler(): @click.option("--vm_prefix", required=True) @click.option("--host_prefix", required=True) @click.option("--request_prefix", required=True) -@click.option("--etcd_host", required=True) -@click.option("--etcd_port", required=True) -def setup(path, vm_prefix, host_prefix, request_prefix, etcd_host, etcd_port): +@click.option("--etcd_url", required=True) +@click.option("--etcd_password", required=True) +def setup(path, vm_prefix, host_prefix, request_prefix, etcd_url, etcd_password): os.chdir(path) repo_name = "ucloud-scheduler" @@ -37,8 +38,8 @@ def setup(path, vm_prefix, host_prefix, request_prefix, etcd_host, etcd_port): f"VM_PREFIX={vm_prefix}\n" f"HOST_PREFIX={host_prefix}\n" f"REQUEST_PREFIX={request_prefix}\n" - f"ETCD_HOST={etcd_host}\n" - f"ETCD_PORT={etcd_port}\n" + f"ETCD_URL={etcd_url}\n" + f"ETCD_PASSWORD={etcd_password}\n" ) op_result.add( @@ -57,4 +58,7 @@ def setup(path, vm_prefix, host_prefix, request_prefix, etcd_host, etcd_port): url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper", ) + shutil.copytree(src=os.path.join(repo_name, "etcd3_wrapper"), + dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper")) + op_result.add(PipenvOperation.install, path=repo_name)