From 920f3e7fb59203e40c60abd5249ba9a0ab8aa804 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Wed, 26 Sep 2018 21:30:19 -0400 Subject: [PATCH] Fix pep8 F402 import shadowing F402 import 'router' from line 44 shadowed by loop variable Trivialfix Change-Id: Ia0d42506889074d3e84a54f3bf29240e7885245e --- neutron/services/portforwarding/pf_plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron/services/portforwarding/pf_plugin.py b/neutron/services/portforwarding/pf_plugin.py index 7d2709f5f2e..326b0cfc16a 100644 --- a/neutron/services/portforwarding/pf_plugin.py +++ b/neutron/services/portforwarding/pf_plugin.py @@ -41,7 +41,7 @@ from neutron.db import db_base_plugin_common from neutron.extensions import floating_ip_port_forwarding as fip_pf from neutron.objects import base as base_obj from neutron.objects import port_forwarding as pf -from neutron.objects import router +from neutron.objects import router as l3_obj from neutron.services.portforwarding.common import exceptions as pf_exc LOG = logging.getLogger(__name__) @@ -203,7 +203,7 @@ class PortForwardingPlugin(fip_pf.PortForwardingPluginBase): pf_objs = pf.PortForwarding.get_objects( context, floatingip_id=pf_resource.floatingip_id) if len(pf_objs) == 1 and pf_objs[0].id == pf_resource.id: - fip_obj = router.FloatingIP.get_object( + fip_obj = l3_obj.FloatingIP.get_object( context, id=pf_resource.floatingip_id) fip_obj.update_fields({'router_id': None}) fip_obj.update() @@ -305,7 +305,7 @@ class PortForwardingPlugin(fip_pf.PortForwardingPluginBase): if not fip_obj.router_id: values = {'router_id': router_id, 'fixed_port_id': None} - router.FloatingIP.update_objects( + l3_obj.FloatingIP.update_objects( context, values, id=floatingip_id) try: pf_obj.create() @@ -413,7 +413,7 @@ class PortForwardingPlugin(fip_pf.PortForwardingPluginBase): return (objs[0], param) def _get_fip_obj(self, context, fip_id): - fip_obj = router.FloatingIP.get_object(context, id=fip_id) + fip_obj = l3_obj.FloatingIP.get_object(context, id=fip_id) if not fip_obj: raise lib_l3_exc.FloatingIPNotFound(floatingip_id=fip_id) return fip_obj