Browse code

Merge "Configure [neutron] in nova_cell*.conf"

Zuul authored on 2018/06/25 19:35:07
Showing 3 changed files
... ...
@@ -325,25 +325,27 @@ function configure_neutron_rootwrap {
325 325
 }
326 326
 
327 327
 # Make Neutron-required changes to nova.conf
328
+# Takes a single argument which is the config file to update.
328 329
 function configure_neutron_nova_new {
329
-    iniset $NOVA_CONF DEFAULT use_neutron True
330
-    iniset $NOVA_CONF neutron auth_type "password"
331
-    iniset $NOVA_CONF neutron auth_url "$KEYSTONE_SERVICE_URI"
332
-    iniset $NOVA_CONF neutron username neutron
333
-    iniset $NOVA_CONF neutron password "$SERVICE_PASSWORD"
334
-    iniset $NOVA_CONF neutron user_domain_name "Default"
335
-    iniset $NOVA_CONF neutron project_name "$SERVICE_TENANT_NAME"
336
-    iniset $NOVA_CONF neutron project_domain_name "Default"
337
-    iniset $NOVA_CONF neutron auth_strategy $NEUTRON_AUTH_STRATEGY
338
-    iniset $NOVA_CONF neutron region_name "$REGION_NAME"
339
-
340
-    iniset $NOVA_CONF DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
330
+    local conf="$1"
331
+    iniset $conf DEFAULT use_neutron True
332
+    iniset $conf neutron auth_type "password"
333
+    iniset $conf neutron auth_url "$KEYSTONE_SERVICE_URI"
334
+    iniset $conf neutron username neutron
335
+    iniset $conf neutron password "$SERVICE_PASSWORD"
336
+    iniset $conf neutron user_domain_name "Default"
337
+    iniset $conf neutron project_name "$SERVICE_TENANT_NAME"
338
+    iniset $conf neutron project_domain_name "Default"
339
+    iniset $conf neutron auth_strategy $NEUTRON_AUTH_STRATEGY
340
+    iniset $conf neutron region_name "$REGION_NAME"
341
+
342
+    iniset $conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
341 343
 
342 344
     # optionally set options in nova_conf
343
-    neutron_plugin_create_nova_conf
345
+    neutron_plugin_create_nova_conf $conf
344 346
 
345 347
     if is_service_enabled neutron-metadata-agent; then
346
-        iniset $NOVA_CONF neutron service_metadata_proxy "True"
348
+        iniset $conf neutron service_metadata_proxy "True"
347 349
     fi
348 350
 
349 351
 }
... ...
@@ -568,9 +570,23 @@ function configure_neutron {
568 568
 function configure_neutron_nova {
569 569
     if is_neutron_legacy_enabled; then
570 570
         # Call back to old function
571
-        create_nova_conf_neutron "$@"
571
+        create_nova_conf_neutron $NOVA_CONF
572
+        if [[ "${CELLSV2_SETUP}" == "superconductor" ]]; then
573
+            for i in $(seq 1 $NOVA_NUM_CELLS); do
574
+                local conf
575
+                conf=$(conductor_conf $i)
576
+                create_nova_conf_neutron $conf
577
+            done
578
+        fi
572 579
     else
573
-        configure_neutron_nova_new "$@"
580
+        configure_neutron_nova_new $NOVA_CONF
581
+        if [[ "${CELLSV2_SETUP}" == "superconductor" ]]; then
582
+            for i in $(seq 1 $NOVA_NUM_CELLS); do
583
+                local conf
584
+                conf=$(conductor_conf $i)
585
+                configure_neutron_nova_new $conf
586
+            done
587
+        fi
574 588
     fi
575 589
 }
576 590
 
... ...
@@ -366,31 +366,32 @@ function configure_mutnauq {
366 366
 }
367 367
 
368 368
 function create_nova_conf_neutron {
369
-    iniset $NOVA_CONF DEFAULT use_neutron True
370
-    iniset $NOVA_CONF neutron auth_type "password"
371
-    iniset $NOVA_CONF neutron auth_url "$KEYSTONE_AUTH_URI"
372
-    iniset $NOVA_CONF neutron username "$Q_ADMIN_USERNAME"
373
-    iniset $NOVA_CONF neutron password "$SERVICE_PASSWORD"
374
-    iniset $NOVA_CONF neutron user_domain_name "$SERVICE_DOMAIN_NAME"
375
-    iniset $NOVA_CONF neutron project_name "$SERVICE_PROJECT_NAME"
376
-    iniset $NOVA_CONF neutron project_domain_name "$SERVICE_DOMAIN_NAME"
377
-    iniset $NOVA_CONF neutron auth_strategy "$Q_AUTH_STRATEGY"
378
-    iniset $NOVA_CONF neutron region_name "$REGION_NAME"
369
+    local conf="$1"
370
+    iniset $conf DEFAULT use_neutron True
371
+    iniset $conf neutron auth_type "password"
372
+    iniset $conf neutron auth_url "$KEYSTONE_AUTH_URI"
373
+    iniset $conf neutron username "$Q_ADMIN_USERNAME"
374
+    iniset $conf neutron password "$SERVICE_PASSWORD"
375
+    iniset $conf neutron user_domain_name "$SERVICE_DOMAIN_NAME"
376
+    iniset $conf neutron project_name "$SERVICE_PROJECT_NAME"
377
+    iniset $conf neutron project_domain_name "$SERVICE_DOMAIN_NAME"
378
+    iniset $conf neutron auth_strategy "$Q_AUTH_STRATEGY"
379
+    iniset $conf neutron region_name "$REGION_NAME"
379 380
 
380 381
     if [[ "$Q_USE_SECGROUP" == "True" ]]; then
381 382
         LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
382
-        iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER
383
+        iniset $conf DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER
383 384
     fi
384 385
 
385 386
     # optionally set options in nova_conf
386
-    neutron_plugin_create_nova_conf
387
+    neutron_plugin_create_nova_conf $conf
387 388
 
388 389
     if is_service_enabled q-meta; then
389
-        iniset $NOVA_CONF neutron service_metadata_proxy "True"
390
+        iniset $conf neutron service_metadata_proxy "True"
390 391
     fi
391 392
 
392
-    iniset $NOVA_CONF DEFAULT vif_plugging_is_fatal "$VIF_PLUGGING_IS_FATAL"
393
-    iniset $NOVA_CONF DEFAULT vif_plugging_timeout "$VIF_PLUGGING_TIMEOUT"
393
+    iniset $conf DEFAULT vif_plugging_is_fatal "$VIF_PLUGGING_IS_FATAL"
394
+    iniset $conf DEFAULT vif_plugging_timeout "$VIF_PLUGGING_TIMEOUT"
394 395
 }
395 396
 
396 397
 # create_mutnauq_accounts() - Set up common required neutron accounts
... ...
@@ -8,10 +8,11 @@ _XTRACE_NEUTRON_NU=$(set +o | grep xtrace)
8 8
 set +o xtrace
9 9
 
10 10
 function neutron_plugin_create_nova_conf {
11
+    local conf="$1"
11 12
     NOVA_OVS_BRIDGE=${NOVA_OVS_BRIDGE:-"br-int"}
12
-    iniset $NOVA_CONF neutron ovs_bridge $NOVA_OVS_BRIDGE
13
+    iniset $conf neutron ovs_bridge $NOVA_OVS_BRIDGE
13 14
     LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
14
-    iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER
15
+    iniset $conf DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER
15 16
 }
16 17
 
17 18
 function neutron_plugin_install_agent_packages {