summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Meyers <chris.meyers.fsu@gmail.com>2015-07-15 18:10:35 +0200
committerChris Meyers <chris.meyers.fsu@gmail.com>2015-07-15 18:18:46 +0200
commit408e25442d329673af11dbf1eb75e3ee53d70ee2 (patch)
treeda65b261fa85d52900023c915e1b3906092d24b5 /tools
parentContinue, don't break out of the iteration (diff)
downloadawx-408e25442d329673af11dbf1eb75e3ee53d70ee2.tar.xz
awx-408e25442d329673af11dbf1eb75e3ee53d70ee2.zip
flake8 fixes
Diffstat (limited to 'tools')
-rwxr-xr-xtools/license-audit/license-audit.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/license-audit/license-audit.py b/tools/license-audit/license-audit.py
index 1b5cd0ea1c..c33092a6d7 100755
--- a/tools/license-audit/license-audit.py
+++ b/tools/license-audit/license-audit.py
@@ -44,7 +44,15 @@ def read_requirements(towerpath):
return ret
def get_python(towerpath):
- excludes = [ 'README*', '*.dist-info', 'funtests', 'easy_install.py', 'oslo', 'pkg_resources', '_markerlib' ]
+ excludes = [
+ 'README*',
+ '*.dist-info',
+ 'funtests',
+ 'easy_install.py',
+ 'oslo',
+ 'pkg_resources',
+ '_markerlib'
+ ]
directory = '%s/awx/lib/site-packages' % (towerpath,)
dirlist = os.listdir(directory)
ret = []
@@ -82,13 +90,13 @@ def get_js(towerpath):
bowerfile.close()
pkg = {}
pkg['name'] = item
- if pkginfo.has_key('license'):
+ if 'license' in pkginfo:
pkg['license'] = normalize_license(pkginfo['license'])
else:
pkg['license'] = 'UNKNOWN'
- if pkginfo.has_key('homepage'):
+ if 'homepage' in pkginfo:
pkg['url'] = pkginfo['homepage']
- elif pkginfo.has_key('url'):
+ elif 'url' in pkginfo:
pkg['url'] = pkginfo['url']
else:
pkg['url'] = 'UNKNOWN'
@@ -209,7 +217,7 @@ for req in requirements.values():
cs_info = cs.release_data(req['name'],req['version'])
if not cs_info:
print "Couldn't find '%s-%s'" %(req['name'],req['version'])
- if not olddata.has_key(req['name']):
+ if 'name' not in olddata:
print "... and it's not in the current data. This needs fixed!"
sys.exit(1)
continue
@@ -233,7 +241,7 @@ for req in requirements.values():
# Update JS package info
for pkg in js:
- if olddata.has_key(pkg):
+ if 'pkg' in olddata:
data = olddata[pkg]
new = js_packages[pkg]
if new['license'] != 'UNKNOWN' and new['license'] != data['license']:
@@ -249,4 +257,4 @@ for pkg in js:
olddata[pkg] = item
continue
-write_csv(outputfile, olddata) \ No newline at end of file
+write_csv(outputfile, olddata)