From 94a61da65e847c9215b01ec41fd0dc5f4a9c8f0b Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Tue, 18 Apr 2023 09:55:15 +0100 Subject: [PATCH] review response --- cylc/flow/task_remote_mgr.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cylc/flow/task_remote_mgr.py b/cylc/flow/task_remote_mgr.py index d32220f5377..56a51fe8677 100644 --- a/cylc/flow/task_remote_mgr.py +++ b/cylc/flow/task_remote_mgr.py @@ -316,19 +316,18 @@ def _get_remote_tidy_targets( A mapping of install targets to valid platforms only where platforms are available. """ - if not platform_names and install_targets: + if install_targets and not platform_names: install_targets_map: Dict[str, List[Dict[str, Any]]] = { t: [] for t in install_targets} + unreachable_targets = install_targets else: install_targets_map = get_install_target_to_platforms_map( platform_names, quiet=True) + # If we couldn't find a platform for a target, we cannot tidy it - + # raise an Error: + unreachable_targets = install_targets.difference( + install_targets_map) - # If we couldn't find a platform for a target, we cannot tidy it - - # raise an Error: - unreachable_targets = [ - t for t, v in install_targets_map.items() - if not v - ] + list(install_targets.difference(install_targets_map)) if unreachable_targets: msg = 'No platforms available to remote tidy install targets:' for unreachable_target in unreachable_targets: