From 5d09c0751877f9502d06c6b64ef5b035a6b7da99 Mon Sep 17 00:00:00 2001 From: Srikanth Aithal Date: Fri, 25 Sep 2026 09:02:24 +0530 Subject: [PATCH] Fix UnboundLocalError in env_check Initialize env_ver_full and env_ver_major from the original OS id before looking up deps_* sections so bootstrap does not crash when a version-specific section is missing. Error before fix: UnboundLocalError: cannot access local variable 'env_ver_major' where it is not associated with a value (avocado-setup.py env_check, elif CONFIGFILE.has_section('deps_%s' % env_ver_major)) Signed-off-by: Srikanth Aithal --- avocado-setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avocado-setup.py b/avocado-setup.py index 8a7c581..482c3bd 100644 --- a/avocado-setup.py +++ b/avocado-setup.py @@ -138,8 +138,8 @@ def env_check(enable_kvm): not_found = [] (env_ver, env_type, cmd_pat) = helper.get_env_type(enable_kvm) # try to check base packages using major version numbers - env_ver = env_ver.split('.')[0] env_ver_full = env_ver.replace('.', '_') # Full version with underscore + env_ver_major = env_ver.split('.')[0] env_deps = [] # Try full version first (e.g., deps_sles16_1) if CONFIGFILE.has_section('deps_%s' % env_ver_full):