From 69663ad67f1c5accef1e4f1b69e61a9090b3053a Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Tue, 21 Jan 2014 22:47:13 -0800 Subject: [PATCH 1/7] Populate BigSwitch plugin restproxy in ML2 CONF --- lib/neutron_plugins/ml2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2 index ab4e3474a6..d9faba3ab4 100644 --- a/lib/neutron_plugins/ml2 +++ b/lib/neutron_plugins/ml2 @@ -112,6 +112,8 @@ function neutron_plugin_configure_service() { populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vxlan $Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vlan $Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS + + populate_ml2_config /$Q_PLUGIN_CONF_FILE restproxy servers=$BS_FL_CONTROLLERS_PORT } function has_neutron_plugin_security_group() { From d4b4c8e2070c327d3fbf39ed026b058ccffd4baf Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 23 Jan 2014 18:16:23 -0800 Subject: [PATCH 2/7] Neutron ML2 bulk support configuration --- lib/neutron_plugins/ml2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2 index d9faba3ab4..c5894d6314 100644 --- a/lib/neutron_plugins/ml2 +++ b/lib/neutron_plugins/ml2 @@ -29,6 +29,8 @@ Q_ML2_PLUGIN_GRE_TYPE_OPTIONS=${Q_ML2_PLUGIN_GRE_TYPE_OPTIONS:-tunnel_id_ranges= Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS=${Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS:-vni_ranges=1001:2000} # Default VLAN TypeDriver options Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS=${Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS:-} +# Default Bulk operation for mechanism drivers +Q_ML2_PLUGIN_BULK_SUPPORT=${Q_ML2_PLUGIN_BULK_SUPPORT:-True} # L3 Plugin to load for ML2 ML2_L3_PLUGIN=${ML2_L3_PLUGIN:-neutron.services.l3_router.l3_router_plugin.L3RouterPlugin} @@ -107,6 +109,8 @@ function neutron_plugin_configure_service() { populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 $Q_SRV_EXTRA_OPTS + populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 bulk_support=$Q_ML2_PLUGIN_BULK_SUPPORT + populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_gre $Q_ML2_PLUGIN_GRE_TYPE_OPTIONS populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vxlan $Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS From 582ae588a917aeb9d4f6e247a15b04c66b1625da Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Wed, 5 Feb 2014 17:10:15 -0800 Subject: [PATCH 3/7] Option to disable SSL for BigSwitch plugin --- lib/neutron_plugins/bigswitch_floodlight | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight index 1e4aa00121..d9df2d971b 100644 --- a/lib/neutron_plugins/bigswitch_floodlight +++ b/lib/neutron_plugins/bigswitch_floodlight @@ -23,6 +23,7 @@ function neutron_plugin_configure_common() { Q_PLUGIN_CLASS="neutron.plugins.bigswitch.plugin.NeutronRestProxyV2" BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80} BS_FL_CONTROLLER_TIMEOUT=${BS_FL_CONTROLLER_TIMEOUT:-10} + BS_FL_SERVER_SSL=${BS_FL_SERVER_SSL:-False} } function neutron_plugin_configure_debug_command() { @@ -44,6 +45,7 @@ function neutron_plugin_configure_plugin_agent() { function neutron_plugin_configure_service() { iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT + iniset /$Q_PLUGIN_CONF_FILE restproxy server_ssl $BS_FL_SERVER_SSL if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs fi From 932bfea131f083722316eb9370e39f1a4ec62747 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 13 Feb 2014 20:43:56 -0800 Subject: [PATCH 4/7] Disable SSL bigswitch ML2 --- lib/neutron_plugins/ml2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2 index c5894d6314..8ac54812d0 100644 --- a/lib/neutron_plugins/ml2 +++ b/lib/neutron_plugins/ml2 @@ -118,6 +118,8 @@ function neutron_plugin_configure_service() { populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vlan $Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS populate_ml2_config /$Q_PLUGIN_CONF_FILE restproxy servers=$BS_FL_CONTROLLERS_PORT + + populate_ml2_config /$Q_PLUGIN_CONF_FILE restproxy server_ssl=False } function has_neutron_plugin_security_group() { From a0432cbad181feb734dccdf4448fb9f52f2ead9d Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Mon, 4 Aug 2014 11:25:20 -0600 Subject: [PATCH 5/7] Don't set tunnel_types on VLAN network type The current code sets tunnel types for the neutron agent even when the network type is 'vlan'. This results in the agent not starting because 'vlan' is not a valid tunnel type. This patch changes it so tunnel_types is not populated when vlans are used. This bug just now surfaced because of commit 8feaf6c9516094df58df84479d73779e87a79264 requiring Q_ML2_TENANT_NETWORK_TYPE to be set to avoid being set to the 'local' type. Change-Id: If2bc57b36dad2bfb34df573581acce176604812e --- lib/neutron_plugins/ml2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2 index 4b979fd7a7..7954277a95 100644 --- a/lib/neutron_plugins/ml2 +++ b/lib/neutron_plugins/ml2 @@ -9,7 +9,7 @@ set +o xtrace # Select either 'gre', 'vxlan', or '(gre vxlan)' Q_ML2_TENANT_NETWORK_TYPE=${Q_ML2_TENANT_NETWORK_TYPE:-"vxlan"} # This has to be set here since the agent will set this in the config file -if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "local" ]]; then +if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "local" && "$Q_ML2_TENANT_NETWORK_TYPE" != "vlan" ]]; then Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=$Q_ML2_TENANT_NETWORK_TYPE) elif [[ "$ENABLE_TENANT_TUNNELS" == "True" ]]; then Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=gre) From 0fd0bc05657617053d888657ae726eb58df14946 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Tue, 14 Oct 2014 16:25:24 -0700 Subject: [PATCH 6/7] Revert "Allow multi-line config items in meta-section of local.conf" This reverts commit 6ff21acf4c4d4ef08bbef419ba582cade4da8da7. --- functions-common | 27 -------------------- lib/config | 48 +++------------------------------- tests/test_config.sh | 61 +++----------------------------------------- 3 files changed, 7 insertions(+), 129 deletions(-) diff --git a/functions-common b/functions-common index 1f90da76b0..5b29fd3bf4 100644 --- a/functions-common +++ b/functions-common @@ -119,33 +119,6 @@ function ini_has_option { [ -n "$line" ] } -# Add another config line for a multi-line option. -# It's normally called after iniset of the same option and assumes -# that the section already exists. -# -# Note that iniset_multiline requires all the 'lines' to be supplied -# in the argument list. Doing that will cause incorrect configuration -# if spaces are used in the config values. -# -# iniadd_literal config-file section option value -function iniadd_literal { - local xtrace=$(set +o | grep xtrace) - set +o xtrace - local file=$1 - local section=$2 - local option=$3 - local value=$4 - - [[ -z $section || -z $option ]] && return - - # Add it - sed -i -e "/^\[$section\]/ a\\ -$option = $value -" "$file" - - $xtrace -} - # Set an option in an INI file # iniset config-file section option value function iniset { diff --git a/lib/config b/lib/config index 6e8219cbeb..b44e79aa3d 100644 --- a/lib/config +++ b/lib/config @@ -86,11 +86,7 @@ function merge_config_file { # having to do nasty quoting games get_meta_section $file $matchgroup $configfile | \ $CONFIG_AWK_CMD -v configfile=$configfile ' - BEGIN { - section = "" - last_section = "" - section_count = 0 - } + BEGIN { section = "" } /^\[.+\]/ { gsub("[][]", "", $1); section=$1 @@ -110,48 +106,10 @@ function merge_config_file { # need to strip leading & trailing whitespace from value sub(/^[ \t]*/, "", value) sub(/[ \t]*$/, "", value) - - # cfg_attr_count: number of config lines per [section, attr] - # cfg_attr: two dimensional array to keep all the config lines per [section, attr] - # cfg_section: keep the section names in the same order as they appear in local.conf - # cfg_sec_attr_name: keep the attr names in the same order as they appear in local.conf - if (! (section, attr) in cfg_attr_count) { - if (section != last_section) { - cfg_section[section_count++] = section - last_section = section - } - attr_count = cfg_sec_attr_count[section_count - 1]++ - cfg_sec_attr_name[section_count - 1][attr_count] = attr - - cfg_attr[section, attr][0] = value - cfg_attr_count[section, attr] = 1 - } else { - lno = cfg_attr_count[section, attr]++ - cfg_attr[section, attr][lno] = value - } - } - END { - # Process each section in order - for (sno = 0; sno < section_count; sno++) { - section = cfg_section[sno] - # The ini routines simply append a config item immediately - # after the section header. To keep the same order as defined - # in local.conf, invoke the ini routines in the reverse order - for (attr_no = cfg_sec_attr_count[sno] - 1; attr_no >=0; attr_no--) { - attr = cfg_sec_attr_name[sno][attr_no] - if (cfg_attr_count[section, attr] == 1) - print "iniset " configfile " " section " " attr " \x27" cfg_attr[section, attr][0] "\x27" - else { - # For multiline, invoke the ini routines in the reverse order - count = cfg_attr_count[section, attr] - print "iniset " configfile " " section " " attr " \x27" cfg_attr[section, attr][count - 1] "\x27" - for (l = count -2; l >= 0; l--) - print "iniadd_literal " configfile " " section " " attr " \x27" cfg_attr[section, attr][l] "\x27" - } - } - } + print "iniset " configfile " " section " " attr " \x27" value "\x27" } ' | while read a; do eval "$a"; done + } diff --git a/tests/test_config.sh b/tests/test_config.sh index 696e57f909..6fff29c396 100755 --- a/tests/test_config.sh +++ b/tests/test_config.sh @@ -104,27 +104,6 @@ drivers = driver=python.import.path.Driver [DEFAULT] # next line has trailing space attr = strip_trailing_space - -[[test-multi-sections|test-multi-sections.conf]] -[sec-1] -cfg_item1 = abcd -cfg_item2 = efgh - -[sec-2] -cfg_item1 = abcd -cfg_item3 = /1/2/3/4:5 -cfg_item4 = end - -[sec-3] -cfg_item5 = 5555 -cfg_item6 = 6666 -cfg_item5 = 5555another - -[[test-multiline|test-multiline.conf]] -[multi] -cfg_item1 = "ab":"cd", "ef": "gh" -cfg_item1 = abcd -cfg_item2 = efgh EOF echo -n "get_meta_section_files: test0 doesn't exist: " @@ -206,39 +185,8 @@ VAL=$(cat test2a.conf) # iniset adds a blank line if it creates the file... EXPECT_VAL=" [ddd] -type = new -additional = true" -check_result "$VAL" "$EXPECT_VAL" - -echo -n "merge_config_file test-multi-sections: " -rm -f test-multi-sections.conf -merge_config_file test.conf test-multi-sections test-multi-sections.conf -VAL=$(cat test-multi-sections.conf) -EXPECT_VAL=' -[sec-1] -cfg_item1 = abcd -cfg_item2 = efgh - -[sec-2] -cfg_item1 = abcd -cfg_item3 = /1/2/3/4:5 -cfg_item4 = end - -[sec-3] -cfg_item5 = 5555 -cfg_item5 = 5555another -cfg_item6 = 6666' -check_result "$VAL" "$EXPECT_VAL" - -echo -n "merge_config_file test-multiline: " -rm -f test-multiline.conf -merge_config_file test.conf test-multiline test-multiline.conf -VAL=$(cat test-multiline.conf) -EXPECT_VAL=' -[multi] -cfg_item1 = "ab":"cd", "ef": "gh" -cfg_item1 = abcd -cfg_item2 = efgh' +additional = true +type = new" check_result "$VAL" "$EXPECT_VAL" echo -n "merge_config_group test2: " @@ -248,8 +196,8 @@ VAL=$(cat test2a.conf) # iniset adds a blank line if it creates the file... EXPECT_VAL=" [ddd] -type = new -additional = true" +additional = true +type = new" check_result "$VAL" "$EXPECT_VAL" echo -n "merge_config_group test2 no conf file: " @@ -320,5 +268,4 @@ attr = strip_trailing_space" check_result "$VAL" "$EXPECT_VAL" rm -f test.conf test1c.conf test2a.conf test-quote.conf test-space.conf test-equals.conf test-strip.conf -rm -f test-multiline.conf test-multi-sections.conf rm -rf test-etc From c4f0a2a0c579e0793e09ad094941e775424d2932 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Sat, 17 Jan 2015 11:29:12 -0800 Subject: [PATCH 7/7] Disable shallow cloning with GIT_DEPTH=0 The recent patch to enable shallow cloning added a method to skip it by checking if GIT_DEPTH was null. However, this could never be triggered because if the user specified it as null, the default setting code would take over and set it to 1. This patch allows the user to specify GIT_DEPTH=0 to skip the shallow clone. Change-Id: I00ea7ab54ed51dc3ede9ceb9ff0f11575a035d1c --- functions-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-common b/functions-common index 5bca836d37..09b8418ce1 100644 --- a/functions-common +++ b/functions-common @@ -601,7 +601,7 @@ function git_clone { local git_clone_flags="" RECLONE=$(trueorfalse False RECLONE) - if [[ -n "${GIT_DEPTH}" ]]; then + if [[ "${GIT_DEPTH}" -gt "0" ]]; then git_clone_flags="$git_clone_flags --depth $GIT_DEPTH" fi