blob: 37ba019b9827d73f14d055a7416eecb787db6735 [file] [log] [blame]
Emilien Macchi40546f72013-09-24 15:10:25 +02001# Neutron metering plugin
2# ---------------------------
3
4# Save trace setting
Dean Troyere3a91602014-03-28 12:40:56 -05005METER_XTRACE=$(set +o | grep xtrace)
Emilien Macchi40546f72013-09-24 15:10:25 +02006set +o xtrace
7
8
9AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent"
10METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin"
11
Ian Wienandaee18c72014-02-21 15:35:08 +110012function neutron_agent_metering_configure_common {
Isaku Yamahata9e136b42013-12-16 15:52:03 +090013 _neutron_service_plugin_class_add $METERING_PLUGIN
Emilien Macchi40546f72013-09-24 15:10:25 +020014}
15
Ian Wienandaee18c72014-02-21 15:35:08 +110016function neutron_agent_metering_configure_agent {
Emilien Macchi40546f72013-09-24 15:10:25 +020017 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 Wienandaee18c72014-02-21 15:35:08 +110025function neutron_metering_stop {
Chris Dent36891dc2015-02-03 16:22:44 +000026 stop_process q-metering
Akihiro Motokiedddb1f2013-12-09 20:21:06 +090027}
28
Emilien Macchi40546f72013-09-24 15:10:25 +020029# Restore xtrace
Dean Troyere3a91602014-03-28 12:40:56 -050030$METER_XTRACE