Skip to content

Commit

Permalink
Fix typo and crontab issue on wcoss dell in workflow python scripts (#…
Browse files Browse the repository at this point in the history
…750)

* Fix typo and failure on wcoss

* fix new line issue on wcoss dell

* remove capture_output

* Get USER from environment

Co-authored-by: Daniel Abdi <daniel.abdi@noaa.gov>
  • Loading branch information
chan-hoo and danielabdi-noaa authored Apr 28, 2022
1 parent bf0fae9 commit e2fa6fc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ush/generate_FV3LAM_wflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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\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
Expand Down
6 changes: 3 additions & 3 deletions ush/get_crontab_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +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)

#
# Make sure called_from_cron is set to a valid value.
#
Expand Down Expand Up @@ -79,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')
1 change: 0 additions & 1 deletion ush/retrieve_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' \
Expand Down
2 changes: 1 addition & 1 deletion ush/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
#-----------------------------------------------------------------------
Expand Down

0 comments on commit e2fa6fc

Please sign in to comment.