From 9e0a3fdb6507cf0c7e3864dc97fbb4cd41cdf3b7 Mon Sep 17 00:00:00 2001 From: Cristovao Cordeiro Date: Tue, 9 Apr 2024 10:48:41 +0200 Subject: [PATCH] fix(rockcraft_lpci_build): both build-base and build_base are allowed --- rockcraft_lpci_build/rockcraft_lpci_build.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rockcraft_lpci_build/rockcraft_lpci_build.py b/rockcraft_lpci_build/rockcraft_lpci_build.py index 76ef1bb..3c29df8 100755 --- a/rockcraft_lpci_build/rockcraft_lpci_build.py +++ b/rockcraft_lpci_build/rockcraft_lpci_build.py @@ -314,9 +314,13 @@ def get_rock_archs(self) -> list: def get_rock_build_base(self) -> str: """Infer the Ubuntu series for lpci, from the rockcraft.yaml file""" - try: - build_base = self.rockcraft_yaml_raw["build_base"] - except KeyError: + build_base = self.rockcraft_yaml_raw.get( + "build-base", self.rockcraft_yaml_raw.get("build_base") + ) + + if not build_base: + logging.info(f"No 'build-base' in the rockfile. Using 'base' instead") + logging.info(self.rockcraft_yaml_raw) try: build_base = self.rockcraft_yaml_raw["base"] except KeyError: @@ -459,7 +463,7 @@ def wait_for_lp_builds(self) -> list: logging.error("%s Continuing", error_msg) continue - logging.error("%s. Keeping the Launchpad repo alive", error_msg) + logging.error("%s Keeping the Launchpad repo alive", error_msg) atexit.unregister(self.delete_git_repository) raise LaunchpadBuildFailure() else: