Skip to content

Add error checking to the --keep option to case.setup #4971

@ekluzek

Description

@ekluzek

Updating this to cover the thing that should change. The "--keep" option to case.setup doesn't' do error checking so you may enter bad data, or enter a delimited list and think it's going to work and it will silently ignore what you ask it to do. So adding some error checking for the names of the files that can be asked for which make this more usable for users.

Original post: This is what I originally saw....

The keep option to case.setup says:

  -k KEEP, --keep KEEP  When cleaning/resetting a case, do not remove/refresh files in this list. Choices are batch script, env_mach_specific.xml, Macros.make, Macros.cmake. Use should use this if you have local modifications to these files that you want to keep.

I've tried using different delimiters for the list, and it doesn't seem to recognize all the files.

This is in cime6.1.169 with other submodules from ctsm5.4.034.

How to reproduce:

./case.setup --reset --keep 'env_mach_specific.xml;Macros.make;Macros.cmake'

Shows that all the files listed were still cleaned (I've tried delimiters or ",", ";" (as above) and " "):

Successfully cleaned .case.test
Successfully cleaned env_mach_specific.xml
Successfully cleaned Macros.cmake
Successfully cleaned cmake_macros

When I ask for a single file it removes that file from the list

/case.setup --reset --keep 'env_mach_specific.xml'
Setting up test for SMS in directory /glade/derecho/scratch/erik/tests_ctsm5434erikhacknia/SMS_D.f10_f10_mg37.I2000Clm60BgcCrop.derecho_nvhpc.clm-crop.GC.ctsm5434erikhacknia_nvh
WARNING: Found difference in test REST_OPTION: case: none original value $STOP_OPTION
Successfully cleaned .case.test
Successfully cleaned Macros.cmake
Successfully cleaned cmake_macros

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions