From b6a323e7c3bf0b3064191e2e3e8688ce46dc2399 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Mon, 16 Oct 2023 10:33:33 +1100 Subject: [PATCH] update storage path check to look for sync path in config.yaml --- payu/schedulers/pbs.py | 6 ++---- test/test_sync.py | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/payu/schedulers/pbs.py b/payu/schedulers/pbs.py index 6a881a9d..931fc891 100644 --- a/payu/schedulers/pbs.py +++ b/payu/schedulers/pbs.py @@ -108,13 +108,11 @@ def submit(self, pbs_script, pbs_config, pbs_vars=None, python_exe=None): short_path = pbs_config.get('shortpath', None) if short_path is not None: extra_search_paths.append(short_path) - + module_use_paths = pbs_config.get('modules', {}).get('use', []) extra_search_paths.extend(module_use_paths) - remote_sync_directory = pbs_vars.get('PAYU_SYNC_PATH', None) - if remote_sync_directory is None: - remote_sync_directory = pbs_config.get('sync', {}).get('directory', None) + remote_sync_directory = pbs_config.get('sync', {}).get('path', None) if remote_sync_directory is not None: extra_search_paths.append(remote_sync_directory) storages.update(find_mounts(extra_search_paths, mounts)) diff --git a/test/test_sync.py b/test/test_sync.py index 320c7f08..8c78f0f0 100644 --- a/test/test_sync.py +++ b/test/test_sync.py @@ -193,11 +193,11 @@ def test_sync(): # Function to test expt.sync() - expected_dirs_synced = ['output000', 'output001', 'output002', - 'output003', 'output004', 'pbs_logs'] + expected_dirs_synced = {'output000', 'output001', 'output002', + 'output003', 'output004', 'pbs_logs'} # Test output is moved to remote dir - assert os.listdir(remote_archive) == expected_dirs_synced + assert set(os.listdir(remote_archive)) == expected_dirs_synced # Test inner log files are copied remote_log_path = os.path.join(remote_archive, 'pbs_logs', log_filename)