From c336b873421c954921ee26c22bd9bfe65b330d0c Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Wed, 27 Mar 2024 11:36:26 +0100 Subject: [PATCH] Fix neutron empty string check The variable should be in quotes for the check to work Testing the behavior in bash: current behavior: $ config_file="" $ if [ -n ${config_file} ]; then echo a; fi a $ config_file="abc" $ if [ -n ${config_file} ]; then echo a; fi a behavior with quotes: $ config_file="" $ if [ -n "$config_file" ]; then echo a; fi $ config_file="abc" $ if [ -n "$config_file" ]; then echo a; fi a Change-Id: Iba956d9d4f43b925848174a632aabe58999be74b --- lib/neutron_plugins/ovn_agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/neutron_plugins/ovn_agent b/lib/neutron_plugins/ovn_agent index e646258651..699bd54f4e 100644 --- a/lib/neutron_plugins/ovn_agent +++ b/lib/neutron_plugins/ovn_agent @@ -558,7 +558,7 @@ function configure_ovn { sample_file=$NEUTRON_DIR/etc/neutron_ovn_metadata_agent.ini.sample config_file=$OVN_META_CONF fi - if [ -n ${config_file} ]; then + if [ -n "$config_file" ]; then sudo install -d -o $STACK_USER $NEUTRON_CONF_DIR mkdir -p $NEUTRON_DIR/etc/neutron/plugins/ml2