#!/usr/bin/python from getHttp import getHttp from getJms import getJms from fetchAppList import stripAll apps = stripAll() def http(): lista = [] for app in apps: try: obj = getHttp(app.replace('.yaml', '')) rest, uat, agt, prd, link = obj.getAppVer() for k, v in prd.iteritems(): lista.append(k + '|' + app.replace('.yaml', '') + '|' + v + '\n') except: pass f = open('appVersions.txt', 'w') f.writelines(lista) f.close() def jav(): lista = [] for app in apps: try: obj = getJms(app.replace('.yaml', ''), 'java') rest, uat, agt, prd, link = obj.getVer()
#!/usr/bin/python import json from fetchAppList import stripAll, getAppVer list = stripAll() resultList = [] for i in list: result = "\"" + i.strip('.yaml') + "\"" + ':' + json.dumps(getAppVer(i), indent=2) resultList.append(result) with open('jsonVersion.json', 'w') as f: f.write('{"Apps":{') f.close() with open('jsonVersion.json', 'a') as f: output = "" for i in resultList: output = output + i + ',' f.write(output[:-1]) f.write('}}') f.close()