diff options
author | Toni Ylenius <toni.ylenius@cybercom.com> | 2015-08-05 15:06:00 +0300 |
---|---|---|
committer | Ihar Hrachyshka <ihrachys@redhat.com> | 2015-10-09 15:05:03 +0000 |
commit | c9fb19244f67f4014e436063cbb8c68026f268f3 (patch) | |
tree | ecec36951c1ce831ca446190f260503aa6cbf408 | |
parent | b085857829a45d1818c404d8b54cb5fdd643ab01 (diff) | |
download | neutron-c9fb19244f67f4014e436063cbb8c68026f268f3.tar.gz |
usage_audit: Fix usage_audit to work with ML2
The script didn't work with the ML2 plugin as router related
functionality is moved to the L3 router service plugin. The fix assumes
that the L3 router service plugin is in use, and this seems to apply to
most of the current core plugins.
Change-Id: If3eb7bde4a5b8b9ca2ac0bd7327325f6c0ad620a
Closes-Bug: 1481692
(cherry picked from commit 2bded62d6a6a141e610a06e5f40bb28c0b26da5c)
-rw-r--r-- | neutron/cmd/usage_audit.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/neutron/cmd/usage_audit.py b/neutron/cmd/usage_audit.py index a1efa7e1e4..631309b0ee 100644 --- a/neutron/cmd/usage_audit.py +++ b/neutron/cmd/usage_audit.py @@ -24,6 +24,7 @@ from neutron.common import config from neutron.common import rpc as n_rpc from neutron import context from neutron import manager +from neutron.plugins.common import constants def main(): @@ -32,6 +33,8 @@ def main(): cxt = context.get_admin_context() plugin = manager.NeutronManager.get_plugin() + l3_plugin = manager.NeutronManager.get_service_plugins().get( + constants.L3_ROUTER_NAT) notifier = n_rpc.get_notifier('network') for network in plugin.get_networks(cxt): notifier.info(cxt, 'network.exists', {'network': network}) @@ -39,7 +42,7 @@ def main(): notifier.info(cxt, 'subnet.exists', {'subnet': subnet}) for port in plugin.get_ports(cxt): notifier.info(cxt, 'port.exists', {'port': port}) - for router in plugin.get_routers(cxt): + for router in l3_plugin.get_routers(cxt): notifier.info(cxt, 'router.exists', {'router': router}) - for floatingip in plugin.get_floatingips(cxt): + for floatingip in l3_plugin.get_floatingips(cxt): notifier.info(cxt, 'floatingip.exists', {'floatingip': floatingip}) |