From 5454bcef347fe094b6de74065523db625de4de5e Mon Sep 17 00:00:00 2001 From: Nguyen Hung Phuong Date: Mon, 15 Aug 2016 12:37:26 +0700 Subject: [PATCH] Clean imports in code In some part in the code we import objects. Openstack style guideline recommends to import only modules. http://docs.openstack.org/developer/hacking/#imports Change-Id: I54138598b2556c080b1c61753db505878a9391d0 --- neutron/agent/l3/dvr_edge_ha_router.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/neutron/agent/l3/dvr_edge_ha_router.py b/neutron/agent/l3/dvr_edge_ha_router.py index 9b00a70b68d..6cd0dca7026 100644 --- a/neutron/agent/l3/dvr_edge_ha_router.py +++ b/neutron/agent/l3/dvr_edge_ha_router.py @@ -15,14 +15,15 @@ from neutron_lib import constants -from neutron.agent.l3.dvr_edge_router import DvrEdgeRouter +from neutron.agent.l3 import dvr_edge_router from neutron.agent.l3 import dvr_snat_ns -from neutron.agent.l3.ha_router import HaRouter -from neutron.agent.l3.router_info import RouterInfo +from neutron.agent.l3 import ha_router +from neutron.agent.l3 import router_info from neutron.common import constants as l3_constants -class DvrEdgeHaRouter(DvrEdgeRouter, HaRouter): +class DvrEdgeHaRouter(dvr_edge_router.DvrEdgeRouter, + ha_router.HaRouter): """Router class which represents a centralized SNAT DVR router with HA capabilities. """ @@ -40,7 +41,7 @@ class DvrEdgeHaRouter(DvrEdgeRouter, HaRouter): def internal_network_added(self, port): # Call RouterInfo's internal_network_added (Plugs the port, adds IP) - RouterInfo.internal_network_added(self, port) + router_info.RouterInfo.internal_network_added(self, port) for subnet in port['subnets']: self._set_subnet_arp_info(subnet['id']) @@ -83,7 +84,8 @@ class DvrEdgeHaRouter(DvrEdgeRouter, HaRouter): self._clear_vips(interface_name) def external_gateway_updated(self, ex_gw_port, interface_name): - HaRouter.external_gateway_updated(self, ex_gw_port, interface_name) + ha_router.HaRouter.external_gateway_updated(self, ex_gw_port, + interface_name) def initialize(self, process_monitor): self._create_snat_namespace() @@ -95,7 +97,7 @@ class DvrEdgeHaRouter(DvrEdgeRouter, HaRouter): self.enable_keepalived() def get_router_cidrs(self, device): - return RouterInfo.get_router_cidrs(self, device) + return router_info.RouterInfo.get_router_cidrs(self, device) def _external_gateway_added(self, ex_gw_port, interface_name, ns_name, preserve_ips):