[NEW PATCH] BZ#602338 - Reset vdsm-reg conf file on certificate fingerprint verification failure (via gerrit-bot)

Yotam Oron yoron at redhat.com
Mon Sep 5 14:47:53 UTC 2011


New patch submitted by Yotam Oron (yoron at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/890

commit 89c2ba40822aa306dcf07c6d5b21eca830b6b1d0
Author: Yotam Oron <yoron at redhat.com>
Date:   Thu Sep 1 19:02:46 2011 +0300

    BZ#602338 - Reset vdsm-reg conf file on certificate fingerprint verification failure
    
    When the certificate verification failed, need to reset the vdsm-reg
    conf file so that the ovirt node will not register
    
    Change-Id: I394007e7794dd901356c7f9b582c682e6bfcf325

diff --git a/vdsm_reg/vdsm-config b/vdsm_reg/vdsm-config
index fec26df..f709e9a 100755
--- a/vdsm_reg/vdsm-config
+++ b/vdsm_reg/vdsm-config
@@ -72,6 +72,8 @@ set_addresses() {
 			vdc_managment_server=${managment_server%:*}
 			vdc_managment_port=${managment_server#*:}
 			strRHEVMAddress=$vdc_managment_server
+			tmp_vdsm_reg_conf=`mktemp`
+			cat /etc/vdsm-reg/vdsm-reg.conf > "$tmp_vdsm_reg_conf"
 			echo "checkpoint 3::management_server: $vdc_managment_server, management_port: $vdc_managment_port" >> $LOG 2>&1
 
 			sed --copy -i "s/\(^vdc_host_name=\)\(..*$\)/\1${vdc_managment_server}/" \
@@ -87,9 +89,11 @@ set_addresses() {
 				ret_val=$?
 				echo "$res" >> $LOG 2>&1
 				if [ ! $ret_val -eq 0 ];then
+					mv "$tmp_vdsm_reg_conf" /etc/vdsm-reg/vdsm-reg.conf
 					echo "Rebooting ... " >> $LOG 2>&1
 					/sbin/reboot
 				fi
+				rm -f "$tmp_vdsm_reg_conf"
 			else
 				echo "No management_server_fingerprint found." | tee -a $LOG
 			fi




More information about the vdsm-patches mailing list