Merge 12b5d67986
into fb29a4047c
This commit is contained in:
commit
5c8c833ef3
@ -11,10 +11,16 @@ fi
|
||||
echo $HOSTNAME > /etc/hostname
|
||||
hostname -F /etc/hostname
|
||||
|
||||
#Don't update the /etc/hosts if hostname is not changed
|
||||
#This is to prevent intermittent redis_chassis.server reachability issue
|
||||
if [ $CURRENT_HOSTNAME == $HOSTNAME ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Remove the old hostname entry from hosts file.
|
||||
# But, 'localhost' entry is used by multiple applications. Don't remove it altogether.
|
||||
# Edit contents of /etc/hosts and put in /etc/hosts.new
|
||||
if [ $CURRENT_HOSTNAME != "localhost" ] || [ $CURRENT_HOSTNAME == $HOSTNAME ] ; then
|
||||
if [ $CURRENT_HOSTNAME != "localhost" ] ; then
|
||||
sed "/\s$CURRENT_HOSTNAME$/d" /etc/hosts > /etc/hosts.new
|
||||
else
|
||||
cp -f /etc/hosts /etc/hosts.new
|
||||
|
@ -132,12 +132,23 @@ function clean_up_chassis_db_tables()
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ !($($SONIC_DB_CLI CHASSIS_APP_DB PING | grep -c True) -gt 0) ]]; then
|
||||
return
|
||||
fi
|
||||
until [[ $($SONIC_DB_CLI CHASSIS_APP_DB PING | grep -c True) -gt 0 ]]; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
lc=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' 'hostname'`
|
||||
until [[ -n "${lc}" ]]; do
|
||||
lc=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' 'hostname'`
|
||||
sleep 1
|
||||
done
|
||||
debug "Chassis db clean up for ${SERVICE}$DEV. hostname=$lc"
|
||||
|
||||
asic=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' 'asic_name'`
|
||||
until [[ -n "${asic}" ]]; do
|
||||
asic=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' 'asic_name'`
|
||||
sleep 1
|
||||
done
|
||||
debug "Chassis db clean up for ${SERVICE}$DEV. asic=$asic"
|
||||
|
||||
# First, delete SYSTEM_NEIGH entries
|
||||
num_neigh=`$SONIC_DB_CLI CHASSIS_APP_DB EVAL "
|
||||
|
Reference in New Issue
Block a user