From df0e22349a86c6de9c5b5b81d4d8f32932714443 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Fri, 29 Aug 2014 17:38:54 +1000 Subject: [PATCH] Switch run-time import to using importutils.import_module .. and enable the cyclic-import pylint check, now that this particular import is invisible to pylint. Change-Id: I9bfe7f77742b0db3ebead6a6767ade9b91e54c22 --- .pylintrc | 1 - neutron/policy.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index c738c547c1..c0aa964232 100644 --- a/.pylintrc +++ b/.pylintrc @@ -78,7 +78,6 @@ disable= # "R" Refactor recommendations abstract-class-little-used, abstract-class-not-used, - cyclic-import, duplicate-code, interface-not-implemented, no-self-use, diff --git a/neutron/policy.py b/neutron/policy.py index 4a521617eb..539ba558a1 100644 --- a/neutron/policy.py +++ b/neutron/policy.py @@ -293,9 +293,9 @@ class OwnerCheck(policy.Check): # resource is handled by the core plugin. It might be worth # having a way to map resources to plugins so to make this # check more general - # FIXME(ihrachys): if import is put in global, circular + # NOTE(ihrachys): if import is put in global, circular # import failure occurs - from neutron import manager + manager = importutils.import_module('neutron.manager') f = getattr(manager.NeutronManager.get_instance().plugin, 'get_%s' % parent_res) # f *must* exist, if not found it is better to let neutron