From dd417fa1629aa061d56e0b77893b08c2e4896213 Mon Sep 17 00:00:00 2001 From: Tito Dal Canton Date: Fri, 15 Nov 2024 12:12:14 +0000 Subject: [PATCH] Fix check for pegasus-plan --- pycbc/workflow/pegasus_sites.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pycbc/workflow/pegasus_sites.py b/pycbc/workflow/pegasus_sites.py index f3106e629b8..f4d235a9559 100644 --- a/pycbc/workflow/pegasus_sites.py +++ b/pycbc/workflow/pegasus_sites.py @@ -186,7 +186,16 @@ def add_condorpool_shared_site(sitecat, cp, local_path, local_url): site.add_profiles(Namespace.DAGMAN, key="retry", value="2") # Need to set PEGASUS_HOME peg_home = which('pegasus-plan') - assert peg_home.endswith('bin/pegasus-plan') + if peg_home is None: + raise RuntimeError( + 'pegasus-plan command not found. ' + 'Make sure Pegasus is correctly installed.' + ) + if not peg_home.endswith('bin/pegasus-plan'): + raise RuntimeError( + f'path to pegasus-plan is weird: {peg_home}. ' + 'Make sure Pegasus is correctly installed.' + ) peg_home = peg_home.replace('bin/pegasus-plan', '') site.add_profiles(Namespace.ENV, key="PEGASUS_HOME", value=peg_home) sitecat.add_sites(site)