← Back to team overview

ubuntu-bugcontrol team mailing list archive

[Merge] ~sespiros/ubuntu-qa-tools/+git/ubuntu-qa-tools:uvt-improvements into ubuntu-qa-tools:master

 

Spyros Seimenis has proposed merging ~sespiros/ubuntu-qa-tools/+git/ubuntu-qa-tools:uvt-improvements into ubuntu-qa-tools:master.

Requested reviews:
  Ubuntu Bug Control (ubuntu-bugcontrol)

For more details, see:
https://code.launchpad.net/~sespiros/ubuntu-qa-tools/+git/ubuntu-qa-tools/+merge/409517

Simple test (commands below not working as it is):

uvt new trusty amd64 test
uvt new impish amd64 test
uvt new xenial i386 test
-- 
Your team Ubuntu Bug Control is requested to review the proposed merge of ~sespiros/ubuntu-qa-tools/+git/ubuntu-qa-tools:uvt-improvements into ubuntu-qa-tools:master.
diff --git a/vm-tools/uvt b/vm-tools/uvt
index 233ee46..01b9ed5 100755
--- a/vm-tools/uvt
+++ b/vm-tools/uvt
@@ -2832,6 +2832,12 @@ def download_release_iso(release, release_num, arch, iso_type):
     latest_release = find_latest_release(release_num, iso_type)
 
     release_iso="ubuntu-%s-%s-%s.iso" % (latest_release, iso_type, arch)
+    latest_release = latest_release.split('-')[0]
+
+    if latest_release == "16.04.7" and arch == "i386":
+        print("WARNING: iso not available for i386 on 16.04.7.")
+        print("Falling back to 16.04.6.\n")
+        release_iso="ubuntu-%s-%s-%s.iso" % ("16.04.6", iso_type, arch)
 
     if iso_type in ['mini', 'mini-desktop']:
         url="http://archive.ubuntu.com/ubuntu/dists/%s/main/installer-%s/current/images/netboot/mini.iso"; % (release, arch)
@@ -2908,12 +2914,19 @@ def find_latest_release(release_num, iso_type):
 
     text = re.compile(r'<[^>]+>').sub('', html).split('\n')
     matches = []
+    beta = False;
     for line in text:
         if line.startswith(' ' + release_num):
-            matches.append(line[0:].split('/')[0][1:])
+            matches.append(re.search(r'\d+\.\d+(\.\d+)? ', line).group().strip())
+            if 'Beta' in line:
+                beta = True;
 
     if len(matches) > 0:
         latest_release = sorted(matches)[-1]
+
+        if beta:
+            latest_release +='-beta'
+
         print("Found release %s" % latest_release)
         return latest_release
 

Follow ups