Skip to content

Commit 83a8175

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Wait for OVN dbs also along with sockets"
2 parents d450e14 + 1baa890 commit 83a8175

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

lib/neutron_plugins/ovn_agent

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ Q_LOG_DRIVER_LOG_BASE=${Q_LOG_DRIVER_LOG_BASE:-acl_log_meter}
169169
# Utility Functions
170170
# -----------------
171171

172+
function wait_for_db_file {
173+
local count=0
174+
while [ ! -f $1 ]; do
175+
sleep 1
176+
count=$((count+1))
177+
if [ "$count" -gt 5 ]; then
178+
die $LINENO "DB File $1 not found"
179+
fi
180+
done
181+
}
182+
172183
function wait_for_sock_file {
173184
local count=0
174185
while [ ! -S $1 ]; do
@@ -695,8 +706,11 @@ function start_ovn {
695706
fi
696707

697708
# Wait for the service to be ready
709+
# Check for socket and db files for both OVN NB and SB
698710
wait_for_sock_file $OVS_RUNDIR/ovnnb_db.sock
699711
wait_for_sock_file $OVS_RUNDIR/ovnsb_db.sock
712+
wait_for_db_file $OVN_DATADIR/ovnnb_db.db
713+
wait_for_db_file $OVN_DATADIR/ovnsb_db.db
700714

701715
if is_service_enabled tls-proxy; then
702716
sudo ovn-nbctl --db=unix:$OVS_RUNDIR/ovnnb_db.sock set-ssl $INT_CA_DIR/private/$DEVSTACK_CERT_NAME.key $INT_CA_DIR/$DEVSTACK_CERT_NAME.crt $INT_CA_DIR/ca-chain.pem

0 commit comments

Comments
 (0)