X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=tests%2Flib%2Finstallers%2Fapex;h=f7b9624e15ebb6a536bfaa14f2d000cad9b5a6aa;hb=c9fb5207df1a3aa579d86f413587ec47c41063af;hp=55878decb74ea252fd94c504f672602bef064c0c;hpb=c86393e972ce849a48e1cf43d079be30dd149ed4;p=doctor.git diff --git a/tests/lib/installers/apex b/tests/lib/installers/apex index 55878dec..f7b9624e 100644 --- a/tests/lib/installers/apex +++ b/tests/lib/installers/apex @@ -5,7 +5,7 @@ ssh_opts_cpu="$ssh_opts -i instack_key" function get_installer_ip { is_set INSTALLER_IP && return - INSTALLER_IP=$(get_first_vnic_ip instack) + INSTALLER_IP=$(get_first_vnic_ip undercloud) } function installer_get_ssh_keys { @@ -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