Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

fix: Default to Ubuntu 20.04 Focal, remove xenial #692

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions tubular/scripts/retrieve_latest_base_ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,15 @@ def retrieve_latest_base_ami(environment, deployment, play, override, ubuntu_ver
else:
url = ""
click.secho('Ubuntu version requested: {}'.format(ubuntu_version), fg='green')
if ubuntu_version == "16.04":
url = "https://cloud-images.ubuntu.com/query/xenial/server/released.current.txt"
click.secho('Xenial.\n: {}'.format(url), fg='green')
if ubuntu_version == "20.04":
url = "https://cloud-images.ubuntu.com/query/focal/server/released.current.txt"
click.secho('Focal.\n: {}'.format(url), fg='green')
elif ubuntu_version == "18.04":
url = "https://cloud-images.ubuntu.com/query/bionic/server/released.current.txt"
click.secho('Bionic.\n: {}'.format(url), fg='green')
elif ubuntu_version == "20.04":
url = "https://cloud-images.ubuntu.com/query/focal/server/released.current.txt"
click.secho('Focal.\n: {}'.format(url), fg='green')
if url == "":
url = "https://cloud-images.ubuntu.com/query/xenial/server/released.current.txt"
click.secho('Using default xenial images.\n: {}'.format(url), fg='red')
url = "https://cloud-images.ubuntu.com/query/focal/server/released.current.txt"
click.secho('Using default focal images.\n: {}'.format(url), fg='red')
data = requests.get(url)
parse_ami = re.findall('ebs-ssd(.+?)amd64(.+?){}(.+?)hvm'.format(region), data.content.decode('utf-8'))
ami_id = parse_ami[0][2].strip()
Expand Down
Loading