From 07cbc4a9ce1d41bcb1fcf5962d74f203907db597 Mon Sep 17 00:00:00 2001 From: Eran Gampel Date: Mon, 30 May 2016 17:16:34 +0300 Subject: [PATCH] DF allways consider the lroutre as distributed In the Neutron API for Virtual Router they have support for backward comparability with non distributed routers We should ignore the Boolean parameter in the router create, No need to add this value to the DF router data module The SNAT is handled in the df_l3_service Change-Id: I53937e4d2bdddbc095e020acfdd1c5ffbf3f27be Closes-bug:#1586995 --- dragonflow/controller/df_local_controller.py | 7 +------ dragonflow/db/api_nb.py | 3 --- dragonflow/neutron/plugin.py | 4 ---- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/dragonflow/controller/df_local_controller.py b/dragonflow/controller/df_local_controller.py index 7b2df26bc..134d23da1 100644 --- a/dragonflow/controller/df_local_controller.py +++ b/dragonflow/controller/df_local_controller.py @@ -450,12 +450,7 @@ def floatingip_updated(self, floatingip): if floatingip.get_lport_id(): if self.db_store.get_local_port(floatingip.get_lport_id()) is None: return - if floatingip.get_lrouter_id(): - lrouter = self.db_store.get_router(floatingip.get_lrouter_id()) - # Currently, to implement DNAT for DVR on compute node only - # if distributed is False, DNAT is done on centralized vrouter - if not lrouter.is_distributed(): - return + old_floatingip = self.db_store.get_floatingip(floatingip.get_id()) if old_floatingip is None: # The new floatingip should be associated with a lport diff --git a/dragonflow/db/api_nb.py b/dragonflow/db/api_nb.py index 556175237..ab48ab819 100644 --- a/dragonflow/db/api_nb.py +++ b/dragonflow/db/api_nb.py @@ -907,9 +907,6 @@ def get_ports(self): res.append(LogicalRouterPort(port)) return res - def is_distributed(self): - return self.lrouter.get('distributed', False) - def get_topic(self): return self.lrouter.get('topic') diff --git a/dragonflow/neutron/plugin.py b/dragonflow/neutron/plugin.py index 3fd4c84f0..fe8fc57e6 100644 --- a/dragonflow/neutron/plugin.py +++ b/dragonflow/neutron/plugin.py @@ -760,11 +760,9 @@ def create_router(self, context, router): router_id = router['id'] tenant_id = router['tenant_id'] - is_distributed = router.get('distributed', False) router_name = router.get('name', df_const.DF_ROUTER_DEFAULT_NAME) self.nb_api.create_lrouter(router_id, topic=tenant_id, name=router_name, - distributed=is_distributed, version=router_version, ports=[]) return router @@ -778,11 +776,9 @@ def update_router(self, context, id, router): context.session, id) tenant_id = router['tenant_id'] - is_distributed = router.get('distributed', False) router_name = router.get('name', df_const.DF_ROUTER_DEFAULT_NAME) self.nb_api.update_lrouter(id, topic=tenant_id, name=router_name, - distributed=is_distributed, version=router_version) return router