Skip to content

Commit 8c67103

Browse files
committed
Fix installation with OVN backend and compilation
This patch fixes several issues related to the installation with OVN backend with the OVS/OVN compilation enabled. The OVS/OVN local directories prefix, when both services are compiled, is now "/usr/local". The "ovn_agent._run_process" function is calling "ovs-appctl" to configure the logging settings of several services. Instead of using the service name, the ctl socket file is used instead. That is more robust and does not fail in systems with previous installations. Closes-Bug: #1960514 Change-Id: I69de5333393957593db6e05495f0c3c758efefdf
1 parent 62d6ffa commit 8c67103

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎lib/neutron_plugins/ovn_agent‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ function _run_process {
253253

254254
local testcmd="test -e $OVS_RUNDIR/$service.pid"
255255
test_with_retry "$testcmd" "$service did not start" $SERVICE_TIMEOUT 1
256-
sudo ovs-appctl -t $service vlog/set console:off syslog:info file:info
256+
local service_ctl_file
257+
service_ctl_file=$(ls $OVS_RUNDIR | grep $service | grep ctl)
258+
if [ -z "$service_ctl_file" ]; then
259+
die $LINENO "ctl file for service $service is not present."
260+
fi
261+
sudo ovs-appctl -t $OVS_RUNDIR/$service_ctl_file vlog/set console:off syslog:info file:info
257262
}
258263

259264
function clone_repository {

‎lib/neutron_plugins/ovs_base‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function _neutron_ovs_base_install_ubuntu_dkms {
6868
function _neutron_ovs_base_install_agent_packages {
6969
if [ "$Q_BUILD_OVS_FROM_GIT" == "True" ]; then
7070
remove_ovs_packages
71-
compile_ovs False /usr /var
71+
compile_ovs False /usr/local /var
7272
load_conntrack_gre_module
7373
start_new_ovs
7474
else

‎lib/neutron_plugins/ovs_source‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ function action_openvswitch {
188188
# start_new_ovs() - removes old ovs database, creates a new one and starts ovs
189189
function start_new_ovs {
190190
sudo rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~
191-
sudo /usr/share/openvswitch/scripts/ovs-ctl start
191+
sudo /usr/local/share/openvswitch/scripts/ovs-ctl start
192192
}
193193

194194
# stop_new_ovs() - stops ovs
195195
function stop_new_ovs {
196-
local ovs_ctl='/usr/share/openvswitch/scripts/ovs-ctl'
196+
local ovs_ctl='/usr/local/share/openvswitch/scripts/ovs-ctl'
197197

198198
if [ -x $ovs_ctl ] ; then
199199
sudo $ovs_ctl stop

0 commit comments

Comments
 (0)