From 9887259a8dcc539c8608b969ead29c4dd37f2e50 Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Thu, 29 Aug 2024 13:17:04 +0300 Subject: [PATCH] fixup! Add a function to retrieve information about the product repository from Plesk-related inf3 files --- pleskdistup/common/src/plesk.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pleskdistup/common/src/plesk.py b/pleskdistup/common/src/plesk.py index db9e626..0f6bc66 100644 --- a/pleskdistup/common/src/plesk.py +++ b/pleskdistup/common/src/plesk.py @@ -246,6 +246,14 @@ def get_repository_by_os_from_inf3(inf3_content: typing.Union[ElementTree.Elemen inf3_content = ElementTree.fromstring(inf3_content) for build in inf3_content.findall(".//build"): - if build.get("os_vendor") == os.name and build.get("os_version").split('.')[0] == os.version: - return build.get("config").rsplit("/", 1)[0] + entry_os_vendor = build.get("os_vendor") + entry_os_version = build.get("os_version") + if not entry_os_vendor or not entry_os_version: + continue + + if entry_os_vendor == os.name and entry_os_version.split('.')[0] == os.version: + entry_config_attr = build.get("config") + if entry_config_attr: + return entry_config_attr.rsplit("/", 1)[0] + return None return None