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

Proposed by Spyros Seimenis
Status: Needs review
Proposed branch: ~sespiros/ubuntu-qa-tools/+git/ubuntu-qa-tools:uvt-improvements
Merge into: ubuntu-qa-tools:master
Diff against target: 46 lines (+16/-1)
1 file modified
vm-tools/uvt (+16/-1)
Reviewer Review Type Date Requested Status
Alex Murray Needs Fixing
Review via email: mp+409517@code.launchpad.net

Description of the change

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

uvt new trusty amd64 test
uvt new impish amd64 test
uvt new xenial i386 test

To post a comment you must log in.
7eb9b63... by Spyros Seimenis

Fix to support custom SSH keys

48fdd19... by Spyros Seimenis

Fix to support custom SSH keys (backwards compatible)

Revision history for this message
Alex Murray (alexmurray) wrote :

To maintain backwards compatibility, it would be better to keep vm_ssh_key pointing to the public key and then just drop the .pub suffix from this to get the private key IMO - then we won't break existing configs that use vm_ssh_key.

review: Needs Fixing
f179fb5... by Spyros Seimenis

Revert "Fix to support custom SSH keys"

This reverts commit 7eb9b63186b1c9f45ca067de3bc82580d1d1d586.

Revision history for this message
Spyros Seimenis (sespiros) wrote :

Thanks for the review Alex. I reverted my last commit and added a change which should maintain backwards compatibility.

Revision history for this message
Steve Beattie (sbeattie) wrote :

See inline comments.

Revision history for this message
Steve Beattie (sbeattie) :
Revision history for this message
Spyros Seimenis (sespiros) wrote :

Thanks for taking the time to review the changes and the suggestions. I replied inline.

Revision history for this message
Marc Deslauriers (mdeslaur) :
Revision history for this message
Steve Beattie (sbeattie) wrote :

On Wed, Oct 13, 2021 at 03:13:08PM -0000, Marc Deslauriers wrote:
>
> The dev release isos rarely work, it might not make sense for you to
> deploy the dev release with the ansible script, or it will likely fail
> more often than not.

Hrm, that has not been my experience, but then I am sporadic about
creating devel release vms and once created, just continually
update it. So it's possible I've gotten lucky with them.

--
Steve Beattie
<email address hidden>

Unmerged commits

48fdd19... by Spyros Seimenis

Fix to support custom SSH keys (backwards compatible)

f179fb5... by Spyros Seimenis

Revert "Fix to support custom SSH keys"

This reverts commit 7eb9b63186b1c9f45ca067de3bc82580d1d1d586.

7eb9b63... by Spyros Seimenis

Fix to support custom SSH keys

ab5c3ba... by Spyros Seimenis

Fix case for unavailable server iso for xenial i386

94293d7... by Spyros Seimenis

Add functionality to detect and download devel

74ca745... by Spyros Seimenis

Modify regex that picks the latest version

Current implementation fails to pick up the latest version
for trusty because it is not in a new line in the webpage.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/vm-tools/uvt b/vm-tools/uvt
2index 233ee46..c06b93a 100755
3--- a/vm-tools/uvt
4+++ b/vm-tools/uvt
5@@ -1410,6 +1410,8 @@ def vm_run_command(vm_name, command, root=False, start=False,
6 return False
7
8 ssh_command = ['ssh']
9+ ssh_command += ['-i', uvt_conf['vm_ssh_key'].rsplit('.', 1)[0]]
10+
11 if verbose:
12 ssh_command += ['-vvv']
13 if root:
14@@ -2832,6 +2834,12 @@ def download_release_iso(release, release_num, arch, iso_type):
15 latest_release = find_latest_release(release_num, iso_type)
16
17 release_iso="ubuntu-%s-%s-%s.iso" % (latest_release, iso_type, arch)
18+ latest_release = latest_release.split('-')[0]
19+
20+ if latest_release == "16.04.7" and arch == "i386":
21+ print("WARNING: iso not available for i386 on 16.04.7.")
22+ print("Falling back to 16.04.6.\n")
23+ release_iso="ubuntu-%s-%s-%s.iso" % ("16.04.6", iso_type, arch)
24
25 if iso_type in ['mini', 'mini-desktop']:
26 url="http://archive.ubuntu.com/ubuntu/dists/%s/main/installer-%s/current/images/netboot/mini.iso" % (release, arch)
27@@ -2908,12 +2916,19 @@ def find_latest_release(release_num, iso_type):
28
29 text = re.compile(r'<[^>]+>').sub('', html).split('\n')
30 matches = []
31+ beta = False;
32 for line in text:
33 if line.startswith(' ' + release_num):
34- matches.append(line[0:].split('/')[0][1:])
35+ matches.append(re.search(r'\d+\.\d+(\.\d+)? ', line).group().strip())
36+ if 'Beta' in line:
37+ beta = True;
38
39 if len(matches) > 0:
40 latest_release = sorted(matches)[-1]
41+
42+ if beta:
43+ latest_release +='-beta'
44+
45 print("Found release %s" % latest_release)
46 return latest_release
47

Subscribers

People subscribed via source and target branches