Move apps into a separate path
This patch creates a new path for all apps bundled with Dragonflow: dragonflow.controller.apps And renames several apps so all apps follow the naming convention. Change-Id: I5db9540971503c4f855b04bd281b4333378fd149
This commit is contained in:
parent
a3e748e1b6
commit
81a9bb518b
|
@ -19,7 +19,7 @@ from neutron.conf.agent.metadata import config as metadata_conf
|
|||
from neutron import wsgi
|
||||
|
||||
from dragonflow import conf as cfg
|
||||
from dragonflow.controller import metadata_service_app
|
||||
from dragonflow.controller.apps import metadata_service
|
||||
from dragonflow.controller import service as df_service
|
||||
from dragonflow.db import api_nb
|
||||
|
||||
|
@ -78,7 +78,7 @@ def main():
|
|||
environment_setup()
|
||||
cfg.CONF.set_override('enable_df_pub_sub', False, group='df')
|
||||
nb_api = api_nb.NbApi.get_instance(False)
|
||||
service_instance = metadata_service_app.DFMetadataProxyHandler(
|
||||
service_instance = metadata_service.DFMetadataProxyHandler(
|
||||
cfg.CONF, nb_api)
|
||||
df_service.register_service(
|
||||
'df-metadata-service', nb_api, service_instance)
|
||||
|
|
|
@ -26,10 +26,10 @@ LOG = log.getLogger(__name__)
|
|||
AGING_COOKIE_NAME = 'aging'
|
||||
|
||||
|
||||
class Aging(df_base_app.DFlowApp):
|
||||
class AgingApp(df_base_app.DFlowApp):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Aging, self).__init__(*args, **kwargs)
|
||||
super(AgingApp, self).__init__(*args, **kwargs)
|
||||
self.do_aging = True
|
||||
self._aging_cookie = 0
|
||||
cookies.add_global_cookie_modifier(AGING_COOKIE_NAME, 1,
|
|
@ -14,14 +14,14 @@ from neutron_lib import constants as n_const
|
|||
from oslo_log import log
|
||||
from ryu.ofproto import ether
|
||||
|
||||
from dragonflow.controller.apps import l3_base
|
||||
from dragonflow.controller.common import constants as const
|
||||
from dragonflow.controller import df_base_app
|
||||
from dragonflow.controller import l3_app_base
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class L3ProactiveApp(df_base_app.DFlowApp, l3_app_base.L3AppMixin):
|
||||
class L3ProactiveApp(df_base_app.DFlowApp, l3_base.L3AppMixin):
|
||||
|
||||
def packet_in_handler(self, event):
|
||||
msg = event.msg
|
|
@ -22,9 +22,9 @@ from ryu.lib.packet import ipv6
|
|||
from ryu.lib.packet import packet
|
||||
from ryu.ofproto import ether
|
||||
|
||||
from dragonflow.controller.apps import l3_base
|
||||
from dragonflow.controller.common import constants as const
|
||||
from dragonflow.controller import df_base_app
|
||||
from dragonflow.controller import l3_app_base
|
||||
from dragonflow.db.models import l2
|
||||
from dragonflow.db.models import l3
|
||||
|
||||
|
@ -37,9 +37,9 @@ LOG = log.getLogger(__name__)
|
|||
ROUTER_PORT_BUFFER_ID = 0xff12
|
||||
|
||||
|
||||
class L3App(df_base_app.DFlowApp, l3_app_base.L3AppMixin):
|
||||
class L3ReactiveApp(df_base_app.DFlowApp, l3_base.L3AppMixin):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(L3App, self).__init__(*args, **kwargs)
|
||||
super(L3ReactiveApp, self).__init__(*args, **kwargs)
|
||||
self.idle_timeout = 30
|
||||
self.hard_timeout = 0
|
||||
|
|
@ -36,9 +36,9 @@ VLAN_MASK = utils.get_bitmask(VLAN_TAG_BITS)
|
|||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class ProviderNetworksApp(df_base_app.DFlowApp):
|
||||
class ProviderApp(df_base_app.DFlowApp):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ProviderNetworksApp, self).__init__(*args, **kwargs)
|
||||
super(ProviderApp, self).__init__(*args, **kwargs)
|
||||
self.integration_bridge = cfg.CONF.df.integration_bridge
|
||||
self.logical_networks = logical_networks.LogicalNetworks()
|
||||
self.bridge_mappings = self._parse_bridge_mappings(
|
|
@ -56,7 +56,7 @@ class TestL3ProactiveApp(test_app_base.DFAppTestBase,
|
|||
self.assertEqual(3, self.app.mod_flow.call_count)
|
||||
|
||||
def _test_add_port(self, lport):
|
||||
with mock.patch('dragonflow.controller.l3_proactive_app.'
|
||||
with mock.patch('dragonflow.controller.apps.l3_proactive.'
|
||||
'L3ProactiveApp._add_port_process'
|
||||
) as fake_add_port_process:
|
||||
self.controller.update(lport)
|
||||
|
@ -69,7 +69,7 @@ class TestL3ProactiveApp(test_app_base.DFAppTestBase,
|
|||
|
||||
def _test_remove_port(self, lport):
|
||||
self.controller.update(lport)
|
||||
with mock.patch('dragonflow.controller.l3_proactive_app.'
|
||||
with mock.patch('dragonflow.controller.apps.l3_proactive.'
|
||||
'L3ProactiveApp._remove_port_process'
|
||||
) as fake_remove_port_process:
|
||||
self.controller.delete(lport)
|
||||
|
|
|
@ -18,7 +18,7 @@ import netaddr
|
|||
from neutron.conf.agent.metadata import config as metadata_config
|
||||
from oslo_config import fixture as cfg_fixture
|
||||
|
||||
from dragonflow.controller import metadata_service_app
|
||||
from dragonflow.controller.apps import metadata_service
|
||||
from dragonflow.db.models import ovs
|
||||
from dragonflow.tests import base as tests_base
|
||||
from dragonflow.tests.unit import test_app_base
|
||||
|
@ -71,8 +71,8 @@ class TestMetadataServiceProxy(tests_base.BaseTestCase):
|
|||
self.cfg.config(nova_metadata_host='nova-host',
|
||||
nova_metadata_port=443,
|
||||
nova_metadata_protocol='https')
|
||||
self.proxy = metadata_service_app.DFMetadataProxyHandler(self.cfg.conf,
|
||||
self.nb_api)
|
||||
self.proxy = metadata_service.DFMetadataProxyHandler(self.cfg.conf,
|
||||
self.nb_api)
|
||||
|
||||
def test_proxy_get_headers(self):
|
||||
req = mock.Mock()
|
||||
|
|
36
setup.cfg
36
setup.cfg
|
@ -76,21 +76,21 @@ neutron.service_plugins =
|
|||
oslo.config.opts =
|
||||
dragonflow.conf = dragonflow.conf.opts:list_opts
|
||||
dragonflow.controller.apps =
|
||||
active_port_detection = dragonflow.controller.active_port_detection_app:ActivePortDetectionApp
|
||||
aging = dragonflow.controller.aging_app:Aging
|
||||
chassis_snat = dragonflow.controller.chassis_snat_app:ChassisSNATApp
|
||||
classifier = dragonflow.controller.classifier_app:ClassifierApp
|
||||
dhcp = dragonflow.controller.dhcp_app:DHCPApp
|
||||
dnat = dragonflow.controller.dnat_app:DNATApp
|
||||
l2 = dragonflow.controller.l2_app:L2App
|
||||
legacy_snat = dragonflow.controller.legacy_snat_app:LegacySNatApp
|
||||
l3_proactive = dragonflow.controller.l3_proactive_app:L3ProactiveApp
|
||||
l3_reactive = dragonflow.controller.l3_app:L3App
|
||||
metadata_service = dragonflow.controller.metadata_service_app:MetadataServiceApp
|
||||
migration = dragonflow.controller.migration_app:MigrationApp
|
||||
portqos = dragonflow.controller.portqos_app:PortQosApp
|
||||
portsec = dragonflow.controller.portsec_app:PortSecApp
|
||||
provider = dragonflow.controller.provider_networks_app:ProviderNetworksApp
|
||||
sg = dragonflow.controller.sg_app:SGApp
|
||||
trunk = dragonflow.controller.trunk_app:TrunkApp
|
||||
tunneling = dragonflow.controller.tunneling_app:TunnelingApp
|
||||
active_port_detection = dragonflow.controller.apps.active_port_detection:ActivePortDetectionApp
|
||||
aging = dragonflow.controller.apps.aging:AgingApp
|
||||
chassis_snat = dragonflow.controller.apps.chassis_snat:ChassisSNATApp
|
||||
classifier = dragonflow.controller.apps.classifier:ClassifierApp
|
||||
dhcp = dragonflow.controller.apps.dhcp:DHCPApp
|
||||
dnat = dragonflow.controller.apps.dnat:DNATApp
|
||||
l2 = dragonflow.controller.apps.l2:L2App
|
||||
legacy_snat = dragonflow.controller.apps.legacy_snat:LegacySNatApp
|
||||
l3_proactive = dragonflow.controller.apps.l3_proactive:L3ProactiveApp
|
||||
l3_reactive = dragonflow.controller.apps.l3_reactive:L3ReactiveApp
|
||||
metadata_service = dragonflow.controller.apps.metadata_service:MetadataServiceApp
|
||||
migration = dragonflow.controller.apps.migration:MigrationApp
|
||||
portqos = dragonflow.controller.apps.portqos:PortQosApp
|
||||
portsec = dragonflow.controller.apps.portsec:PortSecApp
|
||||
provider = dragonflow.controller.apps.provider:ProviderApp
|
||||
sg = dragonflow.controller.apps.sg:SGApp
|
||||
trunk = dragonflow.controller.apps.trunk:TrunkApp
|
||||
tunneling = dragonflow.controller.apps.tunneling:TunnelingApp
|
||||
|
|
Loading…
Reference in New Issue