Skip to content

Commit

Permalink
Merge pull request #304 from NOAA-GFDL/fix-error-message
Browse files Browse the repository at this point in the history
 Fix error message for incorrect platform used
  • Loading branch information
singhd789 authored Jan 3, 2025
2 parents e7bdec2 + d013770 commit 1badb0d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fre/make/create_compile_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def compile_create(yamlfile,platform,target,jobs,parallel,execute,verbose):
if modelYaml.platforms.hasPlatform(platformName):
pass
else:
raise ValueError (platformName + " does not exist in " + modelYaml.combined.get("compile").get("platformYaml"))
raise ValueError (f"{platformName} does not exist in platforms.yaml")

platform=modelYaml.platforms.getPlatformFromName(platformName)
## Make the bldDir based on the modelRoot, the platform, and the target
Expand Down
3 changes: 1 addition & 2 deletions fre/make/create_docker_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def dockerfile_create(yamlfile,platform,target,execute):
if modelYaml.platforms.hasPlatform(platformName):
pass
else:
raise ValueError (platformName + " does not exist in " + \
modelYaml.combined.get("compile").get("platformYaml"))
raise ValueError (f"{platformName} does not exist in platforms.yaml")

platform = modelYaml.platforms.getPlatformFromName(platformName)

Expand Down
5 changes: 4 additions & 1 deletion fre/make/create_makefile_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import fre.yamltools.combine_yamls as cy

def makefile_create(yamlfile,platform,target):
"""
Create the makefile
"""
srcDir="src"
checkoutScriptName = "checkout.sh"
baremetalRun = False # This is needed if there are no bare metal runs
Expand Down Expand Up @@ -39,7 +42,7 @@ def makefile_create(yamlfile,platform,target):
if modelYaml.platforms.hasPlatform(platformName):
pass
else:
raise ValueError (platformName + " does not exist in " + modelYaml.combined.get("compile").get("platformYaml"))
raise ValueError (f"{platformName} does not exist in platforms.yaml")

platform=modelYaml.platforms.getPlatformFromName(platformName)
## Make the bldDir based on the modelRoot, the platform, and the target
Expand Down
3 changes: 1 addition & 2 deletions fre/make/run_fremake_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ def fremake_run(yamlfile,platform,target,parallel,jobs,no_parallel_checkout,exec
if modelYaml.platforms.hasPlatform(platformName):
pass
else:
raise ValueError(f'{platformName} does not exist in '
f'{modelYaml.combined.get("compile").get("platformYaml")}')
raise ValueError (f"{platformName} does not exist in platforms.yaml")

platform = modelYaml.platforms.getPlatformFromName(platformName)

Expand Down

0 comments on commit 1badb0d

Please sign in to comment.