Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame^] | 1 | # Neutron metering plugin |
| 2 | # --------------------------- |
| 3 | |
| 4 | # Save trace setting |
| 5 | MY_XTRACE=$(set +o | grep xtrace) |
| 6 | set +o xtrace |
| 7 | |
| 8 | |
| 9 | AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent" |
| 10 | METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin" |
| 11 | |
| 12 | function neutron_agent_metering_configure_common() { |
| 13 | if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then |
| 14 | Q_SERVICE_PLUGIN_CLASSES=$METERING_PLUGIN |
| 15 | else |
| 16 | Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$METERING_PLUGIN" |
| 17 | fi |
| 18 | } |
| 19 | |
| 20 | function neutron_agent_metering_configure_agent() { |
| 21 | METERING_AGENT_CONF_PATH=/etc/neutron/services/metering |
| 22 | mkdir -p $METERING_AGENT_CONF_PATH |
| 23 | |
| 24 | METERING_AGENT_CONF_FILENAME="$METERING_AGENT_CONF_PATH/metering_agent.ini" |
| 25 | |
| 26 | cp $NEUTRON_DIR/etc/metering_agent.ini $METERING_AGENT_CONF_FILENAME |
| 27 | } |
| 28 | |
| 29 | # Restore xtrace |
| 30 | $MY_XTRACE |