#647 Don't check non-existing file
Merged by mikem. Opened by tkopecek.
tkopecek/koji options  into  master

Download 647.patch

If e.g. 'cert' option is not set in config, default value is used. It is also tested for existence and in case file doesn't exist, None value stays in options.cert. In such case following line will throw an exception.

:thumbsup:

Perhaps I'm missing something... How can fn ever be None here?

  • cert_defaults is a literal dictionary defined immediately before the loop
  • we are looping over its keys for name in cert_defaults:
  • we are looking up the value for each key: fn = cert_defaults[name]

There is certainly a bug here, is there an issue for it yet?

Problem lies in that loop as it also check for existence of that file. https://pagure.io/koji/blob/master/f/vm/kojivmd#_170 skips this default if file doesn't exist, so None stays there.

I've created now #665 for that.

I've changed fix to be same as in other components (kojid, ...)

rebased onto ed26745bd1fe808bdc320a3d0819056c1ea0af35

Commit 375343d8 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

Metadata