Code Review
/
bottlenecks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Restructure monitoring scripts
[bottlenecks.git]
/
monitor
/
dispatch
/
automate_barometer_client.py
diff --git
a/monitor/barometer_automated_client_install.py
b/monitor/dispatch/automate_barometer_client.py
similarity index 74%
rename from
monitor/barometer_automated_client_install.py
rename to
monitor/dispatch/automate_barometer_client.py
index
9bb2c6b
..
3a24602
100644
(file)
--- a/
monitor/barometer_automated_client_install.py
+++ b/
monitor/dispatch/automate_barometer_client.py
@@
-13,9
+13,9
@@
import utils.infra_setup.passwordless_SSH.ssh as ssh
logger = logging.getLogger(__name__)
barometer_client_install_sh =\
logger = logging.getLogger(__name__)
barometer_client_install_sh =\
- "/home/opnfv/bottlenecks/monitor/
barometer_install
_client.sh"
+ "/home/opnfv/bottlenecks/monitor/
dispatch/install_barometer
_client.sh"
barometer_client_install_conf =\
barometer_client_install_conf =\
- "/home/opnfv/bottlenecks/monitor/barometer_client.conf"
+ "/home/opnfv/bottlenecks/monitor/
config/
barometer_client.conf"
with open('/tmp/pod.yaml') as f:
dataMap = yaml.safe_load(f)
with open('/tmp/pod.yaml') as f:
dataMap = yaml.safe_load(f)
@@
-30,14
+30,22
@@
with open('/tmp/pod.yaml') as f:
"cd /etc && mkdir barometer_config"
)
if status:
"cd /etc && mkdir barometer_config"
)
if status:
- raise Exception("Command failed with non-zero 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/\
logger.info(stdout.splitlines())
with open(barometer_client_install_conf) as stdin_file:
ssh_d.run("cat > /etc/barometer_config/\
-
barometer_client_collectd
.conf",
+
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)
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")
ssh_d.run("cd /etc/barometer_config/ && bash ./install.sh")