From 60ad70da3382daf5c9f4521d01715269af5db09d Mon Sep 17 00:00:00 2001 From: Lili Deng Date: Wed, 12 Feb 2025 15:11:27 +0800 Subject: [PATCH] add_azure_core_repo: use bionic when the repo doesn't exist for newer distro version --- lisa/operating_system.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisa/operating_system.py b/lisa/operating_system.py index 2e97c3acfd..8f4b334399 100644 --- a/lisa/operating_system.py +++ b/lisa/operating_system.py @@ -1345,6 +1345,12 @@ def add_azure_core_repo( if not code_name: code_name = self.information.codename repo_url = "http://packages.microsoft.com/repos/azurecore/" + + # Only certain code names are allowed for azurecore repo + allowed_code_names = ["bionic", "focal", "jammy", "trusty", "xenial"] + if code_name not in allowed_code_names: + code_name = "bionic" + self.add_repository( repo=(f"deb [arch={arch_name}] {repo_url} {code_name} main"), keys_location=[