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

Commit

Permalink
fix: Default to Ubuntu 20.04 Focal, remove xenial
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmulloy committed Aug 22, 2023
1 parent 467cdcc commit 04bf131
Showing 1 changed file with 5 additions and 8 deletions.
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

0 comments on commit 04bf131

Please sign in to comment.