@@ -256,15 +256,18 @@ def download_from_archive(filename, sub_path='raw_files', env_var='DRAGONS_TEST'
256256 download_it = True
257257 local_path = os .path .join (cache_path , filename )
258258 if os .path .exists (local_path ):
259- # Get the md5 of the file on disk
260- with open (local_path , 'rb' ) as filep :
261- digest = hashlib .file_digest (filep , "md5" )
262- file_md5 = digest .hexdigest ()
263- # Get the md5 from GOA
264- fileinfourl = url .replace ('/file/' , '/jsonfilelist/present/' )
265- fileinfo = requests .get (fileinfourl , headers = {"User-Agent" : "astropy" }).json ()
266- goa_md5 = fileinfo [0 ].get ('data_md5' )
267- download_it = (file_md5 != goa_md5 )
259+ if url .startswith (URL ): # Gemini archive
260+ # Get the md5 of the file on disk
261+ with open (local_path , 'rb' ) as filep :
262+ digest = hashlib .file_digest (filep , "md5" )
263+ file_md5 = digest .hexdigest ()
264+ # Get the md5 from GOA
265+ fileinfourl = url .replace ('/file/' , '/jsonfilelist/present/' )
266+ fileinfo = requests .get (fileinfourl , headers = {"User-Agent" : "astropy" }).json ()
267+ goa_md5 = fileinfo [0 ].get ('data_md5' )
268+ download_it = (file_md5 != goa_md5 )
269+ else :
270+ download_it = False
268271
269272 if download_it :
270273 tmp_path = download_file (url , cache = False )
0 commit comments