#2369 hub: make sure checksum_type is int for DB
Merged a year ago by mikem. Opened a year ago by julian8628.
julian8628/koji checksumtype  into  master

file modified
+4 -3
@@ -6548,7 +6548,7 @@ 

  

          type_mismatches = 0

          for archive in list_archives(filename=comp['filename'], size=comp['filesize']):

-             if archive['checksum_type'] != comp['checksum_type']:

+             if archive['checksum_type'] != koji.CHECKSUM_TYPES[comp['checksum_type']]:

                  type_mismatches += 1

                  continue

              if archive['checksum'] == comp['checksum']:
@@ -7202,14 +7202,15 @@ 

              archiveinfo['checksum_type'] = koji.CHECKSUM_TYPES['sha256']

          else:

              archiveinfo['checksum'] = fileinfo['checksum']

-             archiveinfo['checksum_type'] = fileinfo['checksum_type']

+             archiveinfo['checksum_type'] = koji.CHECKSUM_TYPES[fileinfo['checksum_type']]

          if fileinfo:

              # check against metadata

              if archiveinfo['size'] != fileinfo['filesize']:

                  raise koji.GenericError("File size mismatch for %s: %s != %s" %

                                          (filename, archiveinfo['size'], fileinfo['filesize']))

              if (archiveinfo['checksum'] != fileinfo['checksum'] or

-                     archiveinfo['checksum_type'] != fileinfo['checksum_type']):

+                     archiveinfo['checksum_type'] != koji.CHECKSUM_TYPES[

+                         fileinfo['checksum_type']]):

                  raise koji.GenericError("File checksum mismatch for %s: %s != %s" %

                                          (filename, archiveinfo['checksum'], fileinfo['checksum']))

      archivetype = get_archive_type(filename, strict=True)

Metadata Update from @julian8628:
- Pull-request tagged with: testing-ready

a year ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

a year ago

Commit d0bfda2 fixes this pull-request

Pull-Request has been merged by mikem

a year ago