From 4efc0c0430774493980aaa8f44dd0527008ecee7 Mon Sep 17 00:00:00 2001 From: Mayank Patibandla <34776435+mayankpatibandla@users.noreply.github.com> Date: Wed, 31 Jan 2024 08:39:56 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20offline=20resolve=20templa?= =?UTF-8?q?tes=20(#321)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create list regardless of early access * Remove check for kernel version 3 --- pros/conductor/conductor.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pros/conductor/conductor.py b/pros/conductor/conductor.py index 43713cd1..e3547134 100644 --- a/pros/conductor/conductor.py +++ b/pros/conductor/conductor.py @@ -147,10 +147,12 @@ def resolve_templates(self, identifier: Union[str, BaseTemplate], allow_online: else: query = identifier if allow_offline: + offline_results = list() + if self.use_early_access: - offline_results = list(filter(lambda t: t.satisfies(query, kernel_version=kernel_version), self.early_access_local_templates)) - else: - offline_results = list(filter(lambda t: t.satisfies(query, kernel_version=kernel_version), self.local_templates)) + offline_results.extend(filter(lambda t: t.satisfies(query, kernel_version=kernel_version), self.early_access_local_templates)) + + offline_results.extend(filter(lambda t: t.satisfies(query, kernel_version=kernel_version), self.local_templates)) if unique: results.update(offline_results) @@ -171,7 +173,7 @@ def resolve_templates(self, identifier: Union[str, BaseTemplate], allow_online: logger(__name__).debug('Saving Conductor config after checking for remote updates') self.save() # Save self since there may have been some updates from the depots - if len(results) == 0 and (kernel_version.split('.')[0] == '3' and not self.use_early_access): + if len(results) == 0 and not self.use_early_access: raise dont_send( InvalidTemplateException(f'{identifier.name} does not support kernel version {kernel_version}'))