Browse code

Load neutron-legacy only if enabled

To avoid using legacy functions accidentially.

Depends-On: Ida1f83b6b3ef9b76be13c063c7e35a8703214078
Change-Id: I3ff136fc8330c92007cdfe91b77d7f9865eabd8d

YAMAMOTO Takashi authored on 2016/07/21 17:49:43
Showing 4 changed files
... ...
@@ -90,6 +90,10 @@ function is_neutron_legacy_enabled {
90 90
     return 1
91 91
 }
92 92
 
93
+if is_neutron_legacy_enabled; then
94
+    source $TOP_DIR/lib/neutron-legacy
95
+fi
96
+
93 97
 # cleanup_neutron() - Remove residual data files, anything left over from previous
94 98
 # runs that a clean run would need to clean up
95 99
 function cleanup_neutron_new {
... ...
@@ -568,6 +572,15 @@ function neutron_service_plugin_class_add {
568 568
     fi
569 569
 }
570 570
 
571
+function install_neutron_agent_packages {
572
+    if is_neutron_legacy_enabled; then
573
+        # Call back to old function
574
+        install_neutron_agent_packages_mutnauq "$@"
575
+    else
576
+        :
577
+    fi
578
+}
579
+
571 580
 function start_neutron {
572 581
     if is_neutron_legacy_enabled; then
573 582
         # Call back to old function
... ...
@@ -423,7 +423,7 @@ function install_mutnauq {
423 423
 }
424 424
 
425 425
 # install_neutron_agent_packages() - Collect source and prepare
426
-function install_neutron_agent_packages {
426
+function install_neutron_agent_packages_mutnauq {
427 427
     # radvd doesn't come with the OS. Install it if the l3 service is enabled.
428 428
     if is_service_enabled q-l3; then
429 429
         install_package radvd
... ...
@@ -574,7 +574,6 @@ source $TOP_DIR/lib/cinder
574 574
 source $TOP_DIR/lib/swift
575 575
 source $TOP_DIR/lib/heat
576 576
 source $TOP_DIR/lib/neutron
577
-source $TOP_DIR/lib/neutron-legacy
578 577
 source $TOP_DIR/lib/ldap
579 578
 source $TOP_DIR/lib/dstat
580 579
 source $TOP_DIR/lib/dlm
... ...
@@ -68,7 +68,6 @@ source $TOP_DIR/lib/cinder
68 68
 source $TOP_DIR/lib/swift
69 69
 source $TOP_DIR/lib/heat
70 70
 source $TOP_DIR/lib/neutron
71
-source $TOP_DIR/lib/neutron-legacy
72 71
 source $TOP_DIR/lib/ldap
73 72
 source $TOP_DIR/lib/dstat
74 73
 source $TOP_DIR/lib/dlm