landsat-pds / landsat_ingestor

Scripts and other artifacts for landsat data ingestion into Amazon public hosting.
Apache License 2.0
102 stars 18 forks source link

Fix unbound var #12

Closed kapadia closed 9 years ago

kapadia commented 9 years ago

An unbound var is lingering around when the tarball is corrupt.

+ l8_process_scene.py --verbose -s s3queue --clean --overwrite --list-file job_33861984.csv LC80750192015105LGN00
LC80750192015105LGN00_B1.TIF
LC80750192015105LGN00_B2.TIF
LC80750192015105LGN00_B3.TIF
LC80750192015105LGN00_B4.TIF
LC80750192015105LGN00_B5.TIF
LC80750192015105LGN00_B6.TIF
LC80750192015105LGN00_B7.TIF

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

LC80750192015105LGN00.tar.gz successfully downloaded (402891096 bytes)
tar xvf LC80750192015105LGN00.tar.gz --directory=LC80750192015105LGN00 
Traceback (most recent call last):
  File "landsat_ingestor/ingestor/l8_process_scene.py", line 115, in <module>
    status = main(sys.argv[1:])
  File "landsat_ingestor/ingestor/l8_process_scene.py", line 106, in main
    overwrite = args.overwrite)
  File "landsat_ingestor/ingestor/l8_process_scene.py", line 65, in process
    scene_info.add_mtl_info(scene_dict, scene_root, local_dir)
UnboundLocalError: local variable 'local_dir' referenced before assignment
Task ended with status 1

/cc @warmerdam

kapadia commented 9 years ago

fixed with https://github.com/landsat-pds/landsat_ingestor/commit/6fb82fc265a5c4ea13e81bac440197d2db29174f and https://github.com/landsat-pds/landsat_ingestor/commit/54371e78df8c5374573fda91e8652e3d0723dd49