X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=bottlenecks.git;a=blobdiff_plain;f=monitor%2Fdispatch%2Fautomate_barometer_client.py;fp=monitor%2Fdispatch%2Fautomate_barometer_client.py;h=0000000000000000000000000000000000000000;hp=3a24602872593b764102173f75019c45823f2493;hb=5b78e737e9656ecc7d1b1856ce9aec2bd48459bd;hpb=b1b458428b644e0df7957e3137bc75d658d68ab1 diff --git a/monitor/dispatch/automate_barometer_client.py b/monitor/dispatch/automate_barometer_client.py deleted file mode 100644 index 3a246028..00000000 --- a/monitor/dispatch/automate_barometer_client.py +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Huawei Tech and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -import logging -import yaml -import utils.infra_setup.passwordless_SSH.ssh as ssh - -logger = logging.getLogger(__name__) -barometer_client_install_sh =\ - "/home/opnfv/bottlenecks/monitor/dispatch/install_barometer_client.sh" -barometer_client_install_conf =\ - "/home/opnfv/bottlenecks/monitor/config/barometer_client.conf" - -with open('/tmp/pod.yaml') as f: - dataMap = yaml.safe_load(f) - for x in dataMap: - for y in dataMap[x]: - if (y['role'] == 'Controller') or (y['role'] == 'Compute'): - ip = str(y['ip']) - user = str(y['user']) - pwd = str(y['password']) - ssh_d = ssh.SSH(user, host=ip, password=pwd) - status, stdout, stderr = ssh_d.execute( - "cd /etc && mkdir barometer_config" - ) - if status: - print Exception( - "Command: \"mkdir barometer_config\" failed.") - logger.info(stdout.splitlines()) - with open(barometer_client_install_conf) as stdin_file: - ssh_d.run("cat > /etc/barometer_config/\ -barometer_client.conf", - stdin=stdin_file) - with open(barometer_client_install_sh) as stdin_file: - ssh_d.run("cat > /etc/barometer_config/install.sh", - stdin=stdin_file) - - status, stdout, stderr = ssh_d.execute( - "sudo apt-get install -y docker.io" - ) - if status: - raise Exception("Command for installing docker failed.") - logger.info(stdout.splitlines()) - - ssh_d.run("cd /etc/barometer_config/ && bash ./install.sh")