Browse code

lib/neutron: untangle metering configuration from legacy

The old code assumed _neutron_service_plugin_class_add presence, as well
as used a configuration file path that is not standard (under
/etc/neutron/services/ instead of /etc/neutron/metering_agent.ini).

The patch untangles metering configuration in the new library from that
old and bad code, and reimplements it inline.

This should help the effort to switch gate from lib/neutron-legacy to
lib/neutron.

Change-Id: I0d235498af4b6a70bd5dae6ea178d5aa8ba41e80

Ihar Hrachyshka authored on 2017/02/23 21:09:01
Showing 1 changed files
... ...
@@ -52,9 +52,13 @@ NEUTRON_CORE_PLUGIN_CONF_FILENAME=${NEUTRON_CORE_PLUGIN_CONF_FILENAME:-ml2_conf.
52 52
 NEUTRON_CORE_PLUGIN_CONF_PATH=$NEUTRON_CONF_DIR/plugins/$NEUTRON_CORE_PLUGIN
53 53
 NEUTRON_CORE_PLUGIN_CONF=$NEUTRON_CORE_PLUGIN_CONF_PATH/$NEUTRON_CORE_PLUGIN_CONF_FILENAME
54 54
 
55
+NEUTRON_METERING_AGENT_CONF_FILENAME=${NEUTRON_METERING_AGENT_CONF_FILENAME:-metering_agent.ini}
56
+NEUTRON_METERING_AGENT_CONF=$NEUTRON_CONF_DIR/$NEUTRON_METERING_AGENT_CONF_FILENAME
57
+
55 58
 NEUTRON_AGENT_BINARY=${NEUTRON_AGENT_BINARY:-neutron-$NEUTRON_AGENT-agent}
56 59
 NEUTRON_L3_BINARY=${NEUTRON_L3_BINARY:-neutron-l3-agent}
57 60
 NEUTRON_META_BINARY=${NEUTRON_META_BINARY:-neutron-metadata-agent}
61
+NEUTRON_METERING_BINARY=${NEUTRON_METERING_BINARY:-neutron-metering-agent}
58 62
 
59 63
 # Public facing bits
60 64
 if is_ssl_enabled_service "neutron" || is_service_enabled tls-proxy; then
... ...
@@ -251,9 +255,7 @@ function configure_neutron_new {
251 251
 
252 252
     # Metering
253 253
     if is_service_enabled neutron-metering; then
254
-        source $TOP_DIR/lib/neutron_plugins/services/metering
255
-        neutron_agent_metering_configure_common
256
-        neutron_agent_metering_configure_agent
254
+        cp $NEUTRON_DIR/etc/metering_agent.ini.sample $NEUTRON_METERING_AGENT_CONF
257 255
         neutron_service_plugin_class_add metering
258 256
     fi
259 257
 }
... ...
@@ -454,7 +456,7 @@ function start_neutron_new {
454 454
     fi
455 455
 
456 456
     if is_service_enabled neutron-metering; then
457
-        run_process neutron-metering "$AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
457
+        run_process neutron-metering "$NEUTRON_METERING_BINARY --config-file $NEUTRON_CONF --config-file $NEUTRON_METERING_AGENT_CONF"
458 458
     fi
459 459
 }
460 460