summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorwenjuan dong <dong.wenjuan@zte.com.cn>2017-08-08 10:09:46 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-08 10:09:46 +0000
commita126fdaac45c8b0459763c89d4e69ac7e7d5172d (patch)
tree7921dc357cbe126502e10ca150189b9cc572aa60 /tests/lib
parent82dccaf2306779f70bf443c917120bc1992b2ee3 (diff)
parent5faecd7765f9105d8c43951335fe0220ea2153ec (diff)
Merge "fix the bug: congress server can't be started"
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/installers/apex13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/lib/installers/apex b/tests/lib/installers/apex
index 3d94e1c4..f7b9624e 100644
--- a/tests/lib/installers/apex
+++ b/tests/lib/installers/apex
@@ -44,13 +44,14 @@ function installer_apply_patches {
fi
co_conf=/etc/congress/congress.conf
+ co_conf_bak=/etc/congress/congress.conf.bak
co_entry="congress.datasources.doctor_driver.DoctorDriver"
if sudo grep -e "^drivers.*$co_entry" $co_conf; then
echo "NOTE: congress is configured as we needed"
else
echo "modify the congress config"
- sudo sed -i -e "/^drivers/s/$/,$co_entry # added by doctor script/" \
- $co_conf
+ sudo cp $co_conf $co_conf_bak
+ sudo sed -i -e "/^drivers/s/$/,$co_entry/" $co_conf
sudo systemctl restart openstack-congress-server.service
fi
' > installer_apply_patches_$node.log 2>&1
@@ -90,10 +91,10 @@ function installer_revert_patches {
date
co_conf=/etc/congress/congress.conf
- co_entry="congress.datasources.doctor_driver.DoctorDriver"
- if sudo grep -q -e "# added by doctor script" $co_conf; then
- echo "modify the congress config"
- sudo sed -i -e "/^drivers/s/^\(.*\),$co_entry # added by doctor script/\1/" $co_conf
+ co_conf_bak=/etc/congress/congress.conf.bak
+ if [ -e $co_conf_bak ]; then
+ echo "restore the congress config"
+ sudo mv $co_conf_bak $co_conf
sudo systemctl restart openstack-congress-server.service
fi