~gmdduf/linaro-ci/linaro-ci-anywhere

« back to all changes in this revision

Viewing changes to find_latest.py

  • Committer: Bernard Park
  • Date: 2013-05-17 07:36:32 UTC
  • Revision ID: bernard.park@linaro.org-20130517073632-ij8cpwprvs26zacm
add condition to find_latest url for in-house jenkins operation

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    dates = find_builds(builddates)
70
70
    dates = [int(date) for date in dates]
71
71
    dates.sort()
72
 
    lastdate = dates.pop()
73
 
    lastdate = str(lastdate) + "/"
74
 
    latesturl = urlparse.urljoin(url, lastdate)
75
 
    content = fetcher.get(latesturl)
76
 
    filename = _get_filename(content)
77
 
    tgz_url = os.path.join(latesturl, filename)
78
 
    fetcher.close()
 
72
    if not dates :
 
73
        lastdate = dates.pop()
 
74
        lastdate = str(lastdate) + "/"
 
75
        latesturl = urlparse.urljoin(url, lastdate)
 
76
        content = fetcher.get(latesturl)
 
77
        filename = _get_filename(content)
 
78
        tgz_url = os.path.join(latesturl, filename)
 
79
        fetcher.close()
 
80
    else :
 
81
        tgz_url = ""
79
82
    return tgz_url
80
83
 
81
84
def find_latest_rootfs(rootfs):