mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 01:47:31 -02:30
flake8 fixes
This commit is contained in:
@@ -44,7 +44,15 @@ def read_requirements(towerpath):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def get_python(towerpath):
|
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,)
|
directory = '%s/awx/lib/site-packages' % (towerpath,)
|
||||||
dirlist = os.listdir(directory)
|
dirlist = os.listdir(directory)
|
||||||
ret = []
|
ret = []
|
||||||
@@ -82,13 +90,13 @@ def get_js(towerpath):
|
|||||||
bowerfile.close()
|
bowerfile.close()
|
||||||
pkg = {}
|
pkg = {}
|
||||||
pkg['name'] = item
|
pkg['name'] = item
|
||||||
if pkginfo.has_key('license'):
|
if 'license' in pkginfo:
|
||||||
pkg['license'] = normalize_license(pkginfo['license'])
|
pkg['license'] = normalize_license(pkginfo['license'])
|
||||||
else:
|
else:
|
||||||
pkg['license'] = 'UNKNOWN'
|
pkg['license'] = 'UNKNOWN'
|
||||||
if pkginfo.has_key('homepage'):
|
if 'homepage' in pkginfo:
|
||||||
pkg['url'] = pkginfo['homepage']
|
pkg['url'] = pkginfo['homepage']
|
||||||
elif pkginfo.has_key('url'):
|
elif 'url' in pkginfo:
|
||||||
pkg['url'] = pkginfo['url']
|
pkg['url'] = pkginfo['url']
|
||||||
else:
|
else:
|
||||||
pkg['url'] = 'UNKNOWN'
|
pkg['url'] = 'UNKNOWN'
|
||||||
@@ -209,7 +217,7 @@ for req in requirements.values():
|
|||||||
cs_info = cs.release_data(req['name'],req['version'])
|
cs_info = cs.release_data(req['name'],req['version'])
|
||||||
if not cs_info:
|
if not cs_info:
|
||||||
print "Couldn't find '%s-%s'" %(req['name'],req['version'])
|
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!"
|
print "... and it's not in the current data. This needs fixed!"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
continue
|
continue
|
||||||
@@ -233,7 +241,7 @@ for req in requirements.values():
|
|||||||
|
|
||||||
# Update JS package info
|
# Update JS package info
|
||||||
for pkg in js:
|
for pkg in js:
|
||||||
if olddata.has_key(pkg):
|
if 'pkg' in olddata:
|
||||||
data = olddata[pkg]
|
data = olddata[pkg]
|
||||||
new = js_packages[pkg]
|
new = js_packages[pkg]
|
||||||
if new['license'] != 'UNKNOWN' and new['license'] != data['license']:
|
if new['license'] != 'UNKNOWN' and new['license'] != data['license']:
|
||||||
@@ -249,4 +257,4 @@ for pkg in js:
|
|||||||
olddata[pkg] = item
|
olddata[pkg] = item
|
||||||
continue
|
continue
|
||||||
|
|
||||||
write_csv(outputfile, olddata)
|
write_csv(outputfile, olddata)
|
||||||
|
|||||||
Reference in New Issue
Block a user