]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
import tools/flakes from oslo
authorJoe Gordon <jogo@cloudscaling.com>
Wed, 30 Jan 2013 21:33:31 +0000 (13:33 -0800)
committerJoe Gordon <jogo@cloudscaling.com>
Thu, 31 Jan 2013 18:40:03 +0000 (10:40 -0800)
Change-Id: Iac52a0cc48de9f29a91545e319c144e3f935799d

openstack-common.conf
tools/flakes.py

index aba84d8988f1b20a42e946ff58315e3e3bb53680..d330537e04dcdaaaa11bbc0456c5b3a2309f55bb 100644 (file)
@@ -1,7 +1,7 @@
 [DEFAULT]
 
 # The list of modules to copy from openstack-common
-modules=cfg,exception,excutils,gettextutils,importutils,iniparser,jsonutils,local,rpc,timeutils,log,setup,notifier,context,network_utils,policy,uuidutils,lockutils,fileutils,gettextutils,scheduler,scheduler.filters,scheduler.weights,install_venv_common
+modules=cfg,exception,excutils,gettextutils,importutils,iniparser,jsonutils,local,rpc,timeutils,log,setup,notifier,context,network_utils,policy,uuidutils,lockutils,fileutils,gettextutils,scheduler,scheduler.filters,scheduler.weights,install_venv_common,flakes
 
 # The base module to hold the copy of openstack.common
 base=cinder
index 4b93abc2109df6c4dd34d76074cef1b1ebe7a00c..7f96116ca54923aca789f00c3f7ab26a16ca5775 100644 (file)
@@ -2,21 +2,14 @@
  wrapper for pyflakes to ignore gettext based warning:
      "undefined name '_'"
 
- From https://bugs.launchpad.net/pyflakes/+bug/844592
+ Synced in from openstack-common
 """
-import __builtin__
-import os
 import sys
 
-from pyflakes.scripts.pyflakes import main
+import pyflakes.checker
+from pyflakes.scripts import pyflakes
 
 if __name__ == "__main__":
-    names = os.environ.get('PYFLAKES_BUILTINS', '_')
-    names = [x.strip() for x in names.split(',')]
-    for x in names:
-        if not hasattr(__builtin__, x):
-            setattr(__builtin__, x, True)
-
-    del names, os, __builtin__
-
-    sys.exit(main())
+    orig_builtins = set(pyflakes.checker._MAGIC_GLOBALS)
+    pyflakes.checker._MAGIC_GLOBALS = orig_builtins | set(['_'])
+    sys.exit(pyflakes.main())