broadinstitute / gdctools

Python and UNIX CLI utilities to simplify interaction with the NIH/NCI Genomics Data Commons
Other
31 stars 4 forks source link

Bad --programs and --projects options should fail immediately #2

Closed noblem closed 7 years ago

noblem commented 8 years ago

At present gdctools does not validate --projects and --program options at startup: so bad input like

  %    bin/gdc_dice --config config/tcga.cfg --projects blahblah

causes the dicer to start, acquire a lock, etc ... only to fail (see below). The code can detect this bad input earlier, and fail more gracefully (with a message and exit with suitable error code) before commencing to acquire lock, etc.


2016-07-20 16:26:11,253[INFO]: GDC Dicer Version: 0.3.0 2016-07-20 16:26:11,253[INFO]: Command: gdc_dice.py --config config/tcga.cfg --projects blahblah 2016-07-20 16:26:11,269[INFO]: Mirror timestamp: 9999_99_99 2016-07-20 16:26:11,269[INFO]: Attempting to acquire lock: /xchip/gdac_data/gdc/dice/TCGA/.dice.lock 2016-07-20 16:26:11,281[INFO]: Lock acquired. 2016-07-20 16:26:11,281[INFO]: Attempting to acquire lock: /xchip/gdac_data/gdc/mirror/TCGA/.mirror.lock 2016-07-20 16:26:11,283[INFO]: Lock acquired. 2016-07-20 16:26:11,285[ERROR]: Dicing FAILED: Traceback (most recent call last): File "gdc_dice.py", line 192, in execute self.dice() File "gdc_dice.py", line 133, in dice metadata = meta.latest_metadata(stamp_root) File "/xchip/cga_home/mnoble/src/gdctools/lib/meta.py", line 38, in latest_metadata metadata_files = [f for f in os.listdir(stamp_dir) OSError: [Errno 2] No such file or directory: '/xchip/gdac_data/gdc/mirror/TCGA/blahblah/metadata/9999_99_99'

noblem commented 8 years ago

Implemented for gdc_dice, but needs to be done for gdc_mirror too.

noblem commented 7 years ago

Now implemented for invalid project names given to create_loadfile, too