Skip to content

Commit

Permalink
added filename to findDir path when shutil.move
Browse files Browse the repository at this point in the history
  • Loading branch information
jmpmcmanus committed Jul 7, 2023
1 parent 84d414a commit 5ff6f18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kalpana/kalpana.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,10 @@ def main(args):

# move cog tiff to final directory
finalPathFile = glob.glob(outputDir+'*_epsg4326.tif')[0]
finalFile = finalPathFile.split('/')[-1]
logger.info('The length of the finalPathFile is: '+str(len(finalPathFile)))
try:
shutil.move(finalPathFile, finalDir)
shutil.move(finalPathFile, os.path.join(finalDir, finalFile))
logger.info('Moved cog file '+finalPathFile+' to '+finalDir+' directory.')
shutil.rmtree('/data/'+modelRunID+'/kalpana', ignore_errors=True)
logger.info('Removed TIFF file /data/'+modelRunID+'/kalpana.')
Expand Down Expand Up @@ -385,7 +386,7 @@ def main(args):
finalFile = finalPathFile.split('/')[-1]

try:
shutil.move(finalPathFile, finalDir+finalFile)
shutil.move(finalPathFile, os.path.join(finalDir, finalFile))
logger.info('Created cog file '+finalPathFile+' and move to '+finalDir+' directory.')
except OSError as err:
logger.error(err)
Expand Down

0 comments on commit 5ff6f18

Please sign in to comment.