Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix.platform is regex remote tidy fail #5445

Merged
Merged
13 changes: 6 additions & 7 deletions cylc/flow/task_remote_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down