From 149591daf3c4da7da67e5ceffa01dda40f03e960 Mon Sep 17 00:00:00 2001 From: Daniil Anfimov Date: Tue, 10 Dec 2024 21:33:51 +0200 Subject: [PATCH] Fix AttributeError in BuilderSupervisor --- build_node/build_node_supervisor.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build_node/build_node_supervisor.py b/build_node/build_node_supervisor.py index a35ae7a..18dc1e2 100644 --- a/build_node/build_node_supervisor.py +++ b/build_node/build_node_supervisor.py @@ -99,11 +99,20 @@ def __report_active_tasks(self): def get_excluded_packages(self): if 'excluded_packages' not in self.__cached_config: - uri = f'{self.__config.exclusions_url}/{self.__config.build_node_name}' + uri = urllib.parse.urljoin( + self.config.exclusions_url, + self.config.build_node_name, + ) if file_url_exists(uri): - response = requests.get(uri).text - self.__cached_config['excluded_packages'] = response.splitlines() - + try: + response = requests.get(uri) + response.raise_for_status() + self.__cached_config['excluded_packages'] = ( + response.text.splitlines() + ) + except Exception: + logging.exception('Cannot get excluded packages') + return [] return self.__cached_config.get('excluded_packages', []) def run(self):