#2459 lowercase sigkeys during import/query where needed
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue2434  into  master

file modified
+1 -1
@@ -1524,7 +1524,7 @@ 

          parser.error(_("A signature key must be specified"))

      if len(args) < 2 and not (options.all or options.buildid):

          parser.error(_("At least one RPM must be specified"))

-     key = args.pop(0)

+     key = args.pop(0).lower()

      activate_session(session, goptions)

      if options.all:

          rpms = session.queryRPMSigs(sigkey=key)

file modified
+3 -1
@@ -7471,7 +7471,7 @@ 

          found_key = None

      else:

          found_key = koji.get_sigpacket_key_id(raw_key)

-     if sigkey != found_key:

+     if sigkey.lower() != found_key:

          raise koji.GenericError("Signature key mismatch: got %s, expected %s"

                                  % (found_key, sigkey))

      os.unlink(temp)
@@ -7491,6 +7491,7 @@ 

      if rpm_id is not None:

          clauses.append("rpm_id=%(rpm_id)s")

      if sigkey is not None:

+         sigkey = sigkey.lower()

          clauses.append("sigkey=%(sigkey)s")

      query = QueryProcessor(columns=fields, tables=('rpmsigs',), clauses=clauses,

                             values=locals(), opts=queryOpts)
@@ -7499,6 +7500,7 @@ 

  

  def write_signed_rpm(an_rpm, sigkey, force=False):

      """Write a signed copy of the rpm"""

+     sigkey = sigkey.lower()

      rinfo = get_rpm(an_rpm, strict=True)

      if rinfo['external_repo_id']:

          raise koji.GenericError("Not an internal rpm: %s (from %s)"

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

2 years ago

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

2 years ago

Commit 8215a08 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago