summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2013-01-30 13:26:07 -0800
committerJoe Gordon <jogo@cloudscaling.com>2013-01-31 12:29:14 -0800
commit64ded799076b9e452c3147ad240f85869c39c2cc (patch)
treeca61fa68da6f848683397ac27ac50c13cf3e2c64
parent77dbed11a6bf95d56e563200d175fe3ada553a6f (diff)
downloadnova-64ded799076b9e452c3147ad240f85869c39c2cc.tar.gz
nova-64ded799076b9e452c3147ad240f85869c39c2cc.tar.xz
nova-64ded799076b9e452c3147ad240f85869c39c2cc.zip
import tools/flakes from oslo
Change-Id: Id6d99fe1fd39e8c061f591e9a82058aea9664674
-rw-r--r--openstack-common.conf2
-rw-r--r--tools/flakes.py15
2 files changed, 5 insertions, 12 deletions
diff --git a/openstack-common.conf b/openstack-common.conf
index f9d38ea1d..b0db41d51 100644
--- a/openstack-common.conf
+++ b/openstack-common.conf
@@ -1,7 +1,7 @@
[DEFAULT]
# The list of modules to copy from openstack-common
-modules=cfg,cliutils,context,excutils,eventlet_backdoor,fileutils,gettextutils,importutils,iniparser,jsonutils,local,lockutils,log,network_utils,notifier,plugin,policy,rootwrap,setup,timeutils,rpc,uuidutils,install_venv_common
+modules=cfg,cliutils,context,excutils,eventlet_backdoor,fileutils,gettextutils,importutils,iniparser,jsonutils,local,lockutils,log,network_utils,notifier,plugin,policy,rootwrap,setup,timeutils,rpc,uuidutils,install_venv_common,flakes
# The base module to hold the copy of openstack.common
base=nova
diff --git a/tools/flakes.py b/tools/flakes.py
index f805fd156..7f96116ca 100644
--- a/tools/flakes.py
+++ b/tools/flakes.py
@@ -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
+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__
-
+ orig_builtins = set(pyflakes.checker._MAGIC_GLOBALS)
+ pyflakes.checker._MAGIC_GLOBALS = orig_builtins | set(['_'])
sys.exit(pyflakes.main())