Georgia Garcia has proposed merging ~georgiag/ubuntu-qa-tools:devel-iso into ubuntu-qa-tools:master.
Requested reviews: Ubuntu Bug Control (ubuntu-bugcontrol) For more details, see: https://code.launchpad.net/~georgiag/ubuntu-qa-tools/+git/ubuntu-qa-tools/+merge/457557 -- Your team Ubuntu Bug Control is requested to review the proposed merge of ~georgiag/ubuntu-qa-tools:devel-iso into ubuntu-qa-tools:master.
diff --git a/vm-tools/uvt b/vm-tools/uvt index d181047..ec8dbb7 100755 --- a/vm-tools/uvt +++ b/vm-tools/uvt @@ -105,7 +105,7 @@ def cmd_new(): sys.exit(1) if opt.name: # prefix not needed when using --name - release, arch = args + release, arch, _ = args else: release, arch, prefix = args @@ -2877,6 +2877,33 @@ def download_release_iso(release, release_num, arch, iso_type): print("Fetching release iso...") latest_release = find_latest_release(release_num, iso_type) + if not latest_release: + url="" + # Could be an unreleased version + if iso_type in ['mini', 'mini-desktop']: + release_iso="%s-mini-iso-%s.iso" % (release, arch) + url="https://cdimages.ubuntu.com/ubuntu-mini-iso/daily-live/current/%s" % (release_iso) + elif iso_type == "server": + release_iso="%s-live-server-%s.iso" % (release, arch) + url="https://cdimages.ubuntu.com/ubuntu-server/daily-live/current/%s" % (release_iso) + elif iso_type == "desktop": + release_iso="%s-desktop-%s.iso" % (release, arch) + url="https://cdimage.ubuntu.com/daily-live/current/%s" % (release_iso) + + from urllib.request import urlopen + from urllib.error import URLError + try: + if url: + response = urlopen(url) + if response.getcode() == 200: + download_file(url, release_iso) + return (release_iso, release_num) + print("Could not find release to download! Please download manually.") + sys.exit(1) + except URLError: + print("Could not reach web server! Please download manually.") + sys.exit(1) + release_iso="ubuntu-%s-%s-%s.iso" % (latest_release, iso_type, arch) if latest_release == "16.04.7" and arch == "i386": @@ -2968,8 +2995,7 @@ def find_latest_release(release_num, iso_type): print("Found release %s" % latest_release) return latest_release - print("Could not find release to download! Please download manually.") - sys.exit(1) + return None def check_vm_exists(vm_name, fail=False): '''Checks if the vm already exists'''
_______________________________________________ Mailing list: https://launchpad.net/~ubuntu-bugcontrol Post to : ubuntu-bugcontrol@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-bugcontrol More help : https://help.launchpad.net/ListHelp