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

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Nov 7, 2022
2 parents e9d1816 + b5ceb27 commit 451b8ca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions VirtualMachineService/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2061,17 +2061,22 @@ def add_cluster_machine(
project_name,
project_id,
):
LOG.info(f"Add machine to [{name}] {cluster_id} - {key_name}")
openstack_image = self.get_image(image=image)
if not openstack_image:
LOG.info(f"Add machine to [{name}] {cluster_id} - [Image: {image}] - {key_name}")
try:
openstack_image = self.get_image(image=image)
except imageNotFoundException:
openstack_image = None
for version in ["18.04", "20.04", "22.04"]:
LOG.info(f"Checking if {version} in {image}")

if version in image:
openstack_image = self.get_active_image_by_os_version(
os_version=version.replace(".", ""), os_distro="ubuntu"
)
break
if not openstack_image:
raise imageNotFoundException(Reason=(f"No Image {image} found!"))

if openstack_image and openstack_image.status != "active":
LOG.info(openstack_image)
image_os_version = openstack_image.get("os_version", "ubuntu")
Expand Down

0 comments on commit 451b8ca

Please sign in to comment.