From b8ae3b5c3a33693a97469818f9a6112bf89ef7ca Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:30:40 +0100 Subject: [PATCH] Ensure that warnings triggered by is_validate are triggered by VIP & VR --- cylc/flow/scripts/validate_install_play.py | 5 ++++- cylc/flow/scripts/validate_reinstall.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cylc/flow/scripts/validate_install_play.py b/cylc/flow/scripts/validate_install_play.py index 9343289f987..d701eb02315 100644 --- a/cylc/flow/scripts/validate_install_play.py +++ b/cylc/flow/scripts/validate_install_play.py @@ -86,7 +86,7 @@ def get_option_parser() -> COP: # no sense in a VIP context. if option.kwargs.get('dest') != 'against_source': parser.add_option(*option.args, **option.kwargs) - + parser.set_defaults(is_validate=True) return parser @@ -103,6 +103,9 @@ def main(parser: COP, options: 'Values', workflow_id: Optional[str] = None): log_subcommand('validate', source) asyncio.run(cylc_validate(parser, options, str(source))) + # Unset is validate after validation. + delattr(options, 'is_validate') + log_subcommand('install', source) _, workflow_id = asyncio.run(cylc_install(options, workflow_id)) diff --git a/cylc/flow/scripts/validate_reinstall.py b/cylc/flow/scripts/validate_reinstall.py index 0733512ddad..de1be6dea82 100644 --- a/cylc/flow/scripts/validate_reinstall.py +++ b/cylc/flow/scripts/validate_reinstall.py @@ -97,6 +97,7 @@ def get_option_parser() -> COP: ) for option in VR_OPTIONS: parser.add_option(*option.args, **option.kwargs) + parser.set_defaults(is_validate=True) return parser @@ -169,6 +170,9 @@ async def vr_cli(parser: COP, options: 'Values', workflow_id: str): log_subcommand('validate --against-source', workflow_id) await cylc_validate(parser, options, workflow_id) + # Unset is validate after validation. + delattr(options, 'is_validate') + log_subcommand('reinstall', workflow_id) reinstall_ok = await cylc_reinstall( options, workflow_id,