1 ##############################################################################
2 # Copyright (c) 2018 Huawei Tech and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
13 sys.path.insert(0, '/home/opnfv/bottlenecks/utils/infra_setup/passwordless_SSH/')
16 logger = logging.getLogger(__name__)
17 with open('/tmp/pod.yaml') as f:
18 dataMap = yaml.safe_load(f)
21 if (y['role']=='Controller') or (y['role']=='Compute'):
24 pwd = str(y['password'])
25 ssh_d = ssh.SSH(user, host= ip, password= pwd)
26 status, stdout, stderr = ssh_d.execute("cd /etc && mkdir barometer-config")
28 raise Exception("Command failed with non-zero status.")
29 logger.info(stdout.splitlines())
30 with open("/home/opnfv/bottlenecks/monitor/barometer_client.conf") as stdin_file:
31 ssh_d.run("cat > /etc/barometer-config/barometer_client_collectd.conf", stdin=stdin_file)
33 with open("/home/opnfv/bottlenecks/monitor/barometer_install_client.sh") as stdin_file:
34 ssh_d.run("cat > /etc/barometer-config/install.sh", stdin=stdin_file)
36 ssh_d.run("cd /etc/barometer-config/ && bash ./install.sh")