]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Switch run-time import to using importutils.import_module
authorAngus Lees <gus@inodes.org>
Fri, 29 Aug 2014 07:38:54 +0000 (17:38 +1000)
committerAngus Lees <gus@inodes.org>
Tue, 21 Oct 2014 04:46:33 +0000 (15:46 +1100)
.. and enable the cyclic-import pylint check, now that this particular
import is invisible to pylint.

Change-Id: I9bfe7f77742b0db3ebead6a6767ade9b91e54c22

.pylintrc
neutron/policy.py

index c738c547c1dc78f5b756120906d133c9aa2a534d..c0aa964232ebee592e1b2065e034fe88a0aa3a7a 100644 (file)
--- 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,
index 4a521617ebc95771cfc44ef53d699355b8f8c96c..539ba558a1a2188b5b51c37e79aec94349ece822 100644 (file)
@@ -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