From bc5c5b443f7eb177da25718c71a4b46ba55979b9 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Tue, 26 Apr 2022 18:44:35 +0000 Subject: [PATCH 1/4] Fix typo and failure on wcoss --- ush/generate_FV3LAM_wflow.py | 2 +- ush/get_crontab_contents.py | 5 ++++- ush/setup.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ush/generate_FV3LAM_wflow.py b/ush/generate_FV3LAM_wflow.py index 16a2a6342..86beaaf6a 100755 --- a/ush/generate_FV3LAM_wflow.py +++ b/ush/generate_FV3LAM_wflow.py @@ -512,7 +512,7 @@ def generate_FV3LAM_wflow(): CRONTAB_LINE = \"{CRONTAB_LINE}\"''',verbose=VERBOSE) if MACHINE == "WCOSS_DELL_P3": - run_command(f'''printf "%s" '{CRONTAB_LINE}' >> f"/u/{USER}/cron/mycrontab"''') + run_command(f'''printf "%s" '{CRONTAB_LINE}' >> "/u/{USER}/cron/mycrontab"''') else: # Add a newline to the end of crontab_contents only if it is not empty. # This is needed so that when CRONTAB_LINE is printed out, it appears on diff --git a/ush/get_crontab_contents.py b/ush/get_crontab_contents.py index 8316e7c7d..c14875e74 100644 --- a/ush/get_crontab_contents.py +++ b/ush/get_crontab_contents.py @@ -40,7 +40,10 @@ def get_crontab_contents(called_from_cron): #import all env vars IMPORTS = ["MACHINE"] import_vars(env_vars=IMPORTS) - + + # Get username on current machine + global USER + USER = os.getlogin() # # Make sure called_from_cron is set to a valid value. # diff --git a/ush/setup.py b/ush/setup.py index 3584656eb..cd90f7066 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -428,7 +428,7 @@ def setup(): # #----------------------------------------------------------------------- global USE_MERRA_CLIMO - if USE_MERRA_CLIMO == "FV3_GFS_v15_thompson_mynn_lam3km": + if CCPP_PHYS_SUITE == "FV3_GFS_v15_thompson_mynn_lam3km": USE_MERRA_CLIMO=True # #----------------------------------------------------------------------- From 3d036e0ce2f94d69450014fec77a83a64a471108 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Thu, 28 Apr 2022 12:47:19 +0000 Subject: [PATCH 2/4] fix new line issue on wcoss dell --- ush/generate_FV3LAM_wflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/generate_FV3LAM_wflow.py b/ush/generate_FV3LAM_wflow.py index 86beaaf6a..2391340c4 100755 --- a/ush/generate_FV3LAM_wflow.py +++ b/ush/generate_FV3LAM_wflow.py @@ -512,7 +512,7 @@ def generate_FV3LAM_wflow(): CRONTAB_LINE = \"{CRONTAB_LINE}\"''',verbose=VERBOSE) if MACHINE == "WCOSS_DELL_P3": - run_command(f'''printf "%s" '{CRONTAB_LINE}' >> "/u/{USER}/cron/mycrontab"''') + run_command(f'''printf "%s\n" '{CRONTAB_LINE}' >> "/u/{USER}/cron/mycrontab"''') else: # Add a newline to the end of crontab_contents only if it is not empty. # This is needed so that when CRONTAB_LINE is printed out, it appears on From c8b2c2e6505933a8d4bb79d02ec864683eaed6a9 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Thu, 28 Apr 2022 13:17:17 +0000 Subject: [PATCH 3/4] remove capture_output --- ush/retrieve_data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ush/retrieve_data.py b/ush/retrieve_data.py index 86cb87e07..0b65597be 100755 --- a/ush/retrieve_data.py +++ b/ush/retrieve_data.py @@ -716,7 +716,6 @@ def parse_args(): output = subprocess.run('which hsi', check=True, shell=True, - capture_output=True, ) except subprocess.CalledProcessError: logging.error('You requested the hpss data store, but ' \ From c37d70510fca76e45dcce8a437e6b7578585abce Mon Sep 17 00:00:00 2001 From: Daniel Abdi Date: Thu, 28 Apr 2022 15:57:40 +0000 Subject: [PATCH 4/4] Get USER from environment --- ush/get_crontab_contents.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ush/get_crontab_contents.py b/ush/get_crontab_contents.py index c14875e74..cbb434c69 100644 --- a/ush/get_crontab_contents.py +++ b/ush/get_crontab_contents.py @@ -38,12 +38,9 @@ def get_crontab_contents(called_from_cron): print_input_args(locals()) #import all env vars - IMPORTS = ["MACHINE"] + IMPORTS = ["MACHINE", "USER"] import_vars(env_vars=IMPORTS) - # Get username on current machine - global USER - USER = os.getlogin() # # Make sure called_from_cron is set to a valid value. # @@ -82,5 +79,5 @@ def test_get_crontab_contents(self): self.assertEqual(crontab_cmd, "crontab") def setUp(self): define_macos_utilities(); - set_env_var('DEBUG','FALSE') + set_env_var('DEBUG',False) set_env_var('MACHINE', 'HERA')