Browse code

Merge "lib/neutron: stop loading all config files into all processes"

Jenkins authored on 2017/03/06 23:37:57
Showing 1 changed files
... ...
@@ -70,9 +70,6 @@ NEUTRON_ROOTWRAP=$(get_rootwrap_location neutron)
70 70
 NEUTRON_ROOTWRAP_CONF_FILE=$NEUTRON_CONF_DIR/rootwrap.conf
71 71
 NEUTRON_ROOTWRAP_DAEMON_CMD="sudo $NEUTRON_ROOTWRAP-daemon $NEUTRON_ROOTWRAP_CONF_FILE"
72 72
 
73
-# Add all enabled config files to a single config arg
74
-NEUTRON_CONFIG_ARG=${NEUTRON_CONFIG_ARG:-""}
75
-
76 73
 # Additional neutron api config files
77 74
 declare -a _NEUTRON_SERVER_EXTRA_CONF_FILES_ABS
78 75
 
... ...
@@ -337,7 +334,7 @@ function init_neutron_new {
337 337
     recreate_database neutron
338 338
 
339 339
     # Run Neutron db migrations
340
-    $NEUTRON_BIN_DIR/neutron-db-manage $NEUTRON_CONFIG_ARG upgrade heads
340
+    $NEUTRON_BIN_DIR/neutron-db-manage upgrade heads
341 341
 
342 342
     create_neutron_cache_dir
343 343
 }
... ...
@@ -416,20 +413,19 @@ function start_neutron_api {
416 416
 
417 417
 # start_neutron() - Start running processes, including screen
418 418
 function start_neutron_new {
419
-    _set_config_files
420
-
421 419
     # Start up the neutron agents if enabled
422 420
     # TODO(sc68cal) Make this pluggable so different DevStack plugins for different Neutron plugins
423 421
     # can resolve the $NEUTRON_AGENT_BINARY
424 422
     if is_service_enabled neutron-agent; then
425
-        run_process neutron-agent "$NEUTRON_BIN_DIR/$NEUTRON_AGENT_BINARY $NEUTRON_CONFIG_ARG"
423
+        # TODO(ihrachys) stop loading ml2_conf.ini into agents, instead load agent specific files
424
+        run_process neutron-agent "$NEUTRON_BIN_DIR/$NEUTRON_AGENT_BINARY --config-file $NEUTRON_CONF --config-file $NEUTRON_CORE_PLUGIN_CONF"
426 425
     fi
427 426
     if is_service_enabled neutron-dhcp; then
428 427
         neutron_plugin_configure_dhcp_agent $NEUTRON_DHCP_CONF
429
-        run_process neutron-dhcp "$NEUTRON_BIN_DIR/$NEUTRON_DHCP_BINARY $NEUTRON_CONFIG_ARG"
428
+        run_process neutron-dhcp "$NEUTRON_BIN_DIR/$NEUTRON_DHCP_BINARY --config-file $NEUTRON_CONF --config-file $NEUTRON_DHCP_CONF"
430 429
     fi
431 430
     if is_service_enabled neutron-l3; then
432
-        run_process neutron-l3 "$NEUTRON_BIN_DIR/$NEUTRON_L3_BINARY $NEUTRON_CONFIG_ARG"
431
+        run_process neutron-l3 "$NEUTRON_BIN_DIR/$NEUTRON_L3_BINARY --config-file $NEUTRON_CONF --config-file $NEUTRON_L3_CONF"
433 432
     fi
434 433
     if is_service_enabled neutron-api; then
435 434
         # XXX(sc68cal) - Here's where plugins can wire up their own networks instead
... ...
@@ -444,7 +440,7 @@ function start_neutron_new {
444 444
         fi
445 445
     fi
446 446
     if is_service_enabled neutron-metadata-agent; then
447
-        run_process neutron-metadata-agent "$NEUTRON_BIN_DIR/$NEUTRON_META_BINARY $NEUTRON_CONFIG_ARG"
447
+        run_process neutron-metadata-agent "$NEUTRON_BIN_DIR/$NEUTRON_META_BINARY --config-file $NEUTRON_CONF --config-file $NEUTRON_META_CONF"
448 448
     fi
449 449
 
450 450
     if is_service_enabled neutron-metering; then
... ...
@@ -470,30 +466,6 @@ function stop_neutron_new {
470 470
     fi
471 471
 }
472 472
 
473
-# Compile the lost of enabled config files
474
-function _set_config_files {
475
-
476
-    NEUTRON_CONFIG_ARG+=" --config-file $NEUTRON_CONF"
477
-
478
-    #TODO(sc68cal) OVS and LB agent uses settings in NEUTRON_CORE_PLUGIN_CONF (ml2_conf.ini) but others may not
479
-    if is_service_enabled neutron-agent; then
480
-        NEUTRON_CONFIG_ARG+=" --config-file $NEUTRON_CORE_PLUGIN_CONF"
481
-    fi
482
-
483
-    if is_service_enabled neutron-dhcp; then
484
-        NEUTRON_CONFIG_ARG+=" --config-file $NEUTRON_DHCP_CONF"
485
-    fi
486
-
487
-    if is_service_enabled neutron-l3; then
488
-        NEUTRON_CONFIG_ARG+=" --config-file $NEUTRON_L3_CONF"
489
-    fi
490
-
491
-    if is_service_enabled neutron-metadata-agent; then
492
-        NEUTRON_CONFIG_ARG+=" --config-file $NEUTRON_META_CONF"
493
-    fi
494
-
495
-}
496
-
497 473
 # neutron_service_plugin_class_add() - add service plugin class
498 474
 function neutron_service_plugin_class_add_new {
499 475
     local service_plugin_class=$1