avoid unnecessary file opening

This commit is contained in:
Mike McLean 2017-12-05 23:54:25 -05:00
parent b482e36595
commit bc2bb62032

View file

@ -6255,9 +6255,9 @@ def import_archive_internal(filepath, buildinfo, type, typeInfo, buildroot_id=No
filename = koji.fixEncoding(os.path.basename(filepath))
archiveinfo['filename'] = filename
archiveinfo['size'] = os.path.getsize(filepath)
archivefp = open(filepath)
# trust values computed on hub (CG_Importer.prep_outputs)
if not fileinfo or not getattr(fileinfo, 'hub.checked_md5'):
archivefp = open(filepath)
m = md5_constructor()
while True:
contents = archivefp.read(8192)