X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Fopnfv-artifacts.py;h=2f2cc41ba664db5689f2cbc0e5f41020acb08095;hb=f4a49e142baa93c2b4fa6cc4d1ee0d7eb40ed3f7;hp=f826d5ce64a9ee6fb6b558baec2eff5e2ae00154;hpb=4ff7399fd66525743b3cfd7e3e46d8efc13f0ed5;p=releng.git diff --git a/utils/opnfv-artifacts.py b/utils/opnfv-artifacts.py index f826d5ce6..2f2cc41ba 100644 --- a/utils/opnfv-artifacts.py +++ b/utils/opnfv-artifacts.py @@ -28,56 +28,55 @@ from apiclient.errors import HttpError import argparse import json -import os import sys api = { - 'projects': {}, - 'docs': {}, - 'releases': {}, + 'projects': {}, + 'docs': {}, + 'releases': {}, } releases = [ - 'arno.2015.1.0', - 'arno.2015.2.0', - 'brahmaputra.1.0', + 'arno.2015.1.0', + 'arno.2015.2.0', + 'brahmaputra.1.0', ] # List of file extensions to filter out ignore_extensions = [ - '.buildinfo', - '.woff', - '.ttf', - '.svg', - '.eot', - '.pickle', - '.doctree', - '.js', - '.png', - '.css', - '.gif', - '.jpeg', - '.jpg', - '.bmp', + '.buildinfo', + '.woff', + '.ttf', + '.svg', + '.eot', + '.pickle', + '.doctree', + '.js', + '.png', + '.css', + '.gif', + '.jpeg', + '.jpg', + '.bmp', ] parser = argparse.ArgumentParser( - description='OPNFV Artifacts JSON Generator') + description='OPNFV Artifacts JSON Generator') parser.add_argument( - '-k', - dest='key', - default='', - help='API Key for Google Cloud Storage') + '-k', + dest='key', + default='', + help='API Key for Google Cloud Storage') parser.add_argument( - '-p', - default=None, - dest='pretty', - action='store_const', - const=2, - help='pretty print the output') + '-p', + default=None, + dest='pretty', + action='store_const', + const=2, + help='pretty print the output') # Parse and assign arguments args = parser.parse_args() @@ -130,15 +129,6 @@ def has_logs(gerrit_review): return False -def has_md5hash(item): - """ - If a file has an md5hash available, grab it - """ - if 'md5Hash' in item: - return item['md5Hash'] - return False - - def has_ignorable_extension(filename): for extension in ignore_extensions: if filename.lower().endswith(extension): @@ -156,12 +146,11 @@ def get_results(key): files = storage.objects().list(bucket='artifacts.opnfv.org', fields='nextPageToken,' 'items(' - 'name,' - 'mediaLink,' - 'md5Hash,' - 'updated,' - 'contentType,' - 'size' + 'name,' + 'mediaLink,' + 'updated,' + 'contentType,' + 'size' ')') while (files is not None): sites = files.execute() @@ -182,18 +171,18 @@ def get_results(key): project = site_split[0] name = '/'.join(site_split[1:]) - proxy = "http://build.opnfv.org/artifacts.opnfv.org/%s" % site['name'] + proxy = "http://build.opnfv.org/artifacts.opnfv.org/%s" % site[ + 'name'] if name.endswith('.html'): href = "http://artifacts.opnfv.org/%s" % site['name'] href_type = 'view' else: href = site['mediaLink'] href_type = 'download' - md5 = has_md5hash(site) gerrit = has_gerrit_review(site_split) logs = False # has_logs(gerrit) - documentation = has_documentation(site_split) + # documentation = has_documentation(site_split) release = has_release(site_split) category = 'project' @@ -215,7 +204,6 @@ def get_results(key): 'href': href, 'href_type': href_type, 'proxy_href': proxy, - 'md5hash': md5, } if project in releases: