Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 1 | # Neutron metering plugin |
| 2 | # --------------------------- |
| 3 | |
| 4 | # Save trace setting |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 5 | METER_XTRACE=$(set +o | grep xtrace) |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 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 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 12 | function neutron_agent_metering_configure_common { |
Isaku Yamahata | 9e136b4 | 2013-12-16 15:52:03 +0900 | [diff] [blame] | 13 | _neutron_service_plugin_class_add $METERING_PLUGIN |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 14 | } |
| 15 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 16 | function neutron_agent_metering_configure_agent { |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 17 | METERING_AGENT_CONF_PATH=/etc/neutron/services/metering |
| 18 | mkdir -p $METERING_AGENT_CONF_PATH |
| 19 | |
| 20 | METERING_AGENT_CONF_FILENAME="$METERING_AGENT_CONF_PATH/metering_agent.ini" |
| 21 | |
| 22 | cp $NEUTRON_DIR/etc/metering_agent.ini $METERING_AGENT_CONF_FILENAME |
| 23 | } |
| 24 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 25 | function neutron_metering_stop { |
Chris Dent | 36891dc | 2015-02-03 16:22:44 +0000 | [diff] [blame^] | 26 | stop_process q-metering |
Akihiro Motoki | edddb1f | 2013-12-09 20:21:06 +0900 | [diff] [blame] | 27 | } |
| 28 | |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 29 | # Restore xtrace |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 30 | $METER_XTRACE |