Merge ~jslarraz/ubuntu-qa-tools:fix-find-latest-release into ubuntu-qa-tools:master

Proposed by Jorge Sancho Larraz
Status: Merged
Merged at revision: 2cd04846db11028244d11e85ea3ca739941d3cdf
Proposed branch: ~jslarraz/ubuntu-qa-tools:fix-find-latest-release
Merge into: ubuntu-qa-tools:master
Diff against target: 18 lines (+1/-6)
1 file modified
vm-tools/uvt (+1/-6)
Reviewer Review Type Date Requested Status
Marc Deslauriers Approve
Review via email: mp+460676@code.launchpad.net

Commit message

uvt: fix find_latest_release

Description of the change

find_latest_release seems to stop working properly for some releases. For trusty it returns just 14.04 what leads to an error in the iso download. This MR fixes it

To post a comment you must log in.
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Yep, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/vm-tools/uvt b/vm-tools/uvt
index c7b0143..fca876d 100755
--- a/vm-tools/uvt
+++ b/vm-tools/uvt
@@ -2959,12 +2959,7 @@ def find_latest_release(release_num, iso_type):
2959 print("Could not reach web server! Please download manually.")2959 print("Could not reach web server! Please download manually.")
2960 sys.exit(1)2960 sys.exit(1)
29612961
2962 text = re.compile(r'<[^>]+>').sub('', html).split('\n')2962 matches = re.findall(re.escape(release_num) + "\.\d+", html)
2963 matches = []
2964 for line in text:
2965 if line.startswith(' ' + release_num):
2966 matches.append(re.search(r'(\d+\.\d+(\.\d+)?)\/', line).group(1))
2967
2968 if len(matches) > 0:2963 if len(matches) > 0:
2969 latest_release = sorted(matches)[-1]2964 latest_release = sorted(matches)[-1]
2970 print("Found release %s" % latest_release)2965 print("Found release %s" % latest_release)

Subscribers

People subscribed via source and target branches