#2749 web: optional KojiHubCA usage
Merged 3 years ago by tkopecek. Opened 3 years ago by tkopecek.
tkopecek/koji issue2742  into  master

file modified
+5 -5
@@ -200,12 +200,12 @@ 

  

  

  def _getServer(environ):

-     koji_opts = environ['koji.options']

-     opts = {

-         'serverca': koji_opts.get('KojiHubCA', '')

-     }

+     options = environ['koji.options']

+     opts = {}

+     if os.path.exists(options['KojiHubCA']):

The previous code used get(), and the new code just refers to the dict key directly. Will this end up with a KeyError if KojiHubCA is not defined in options?

+         opts['serverca'] = options['KojiHubCA']

  

-     session = koji.ClientSession(koji_opts['KojiHubURL'], opts=opts)

+     session = koji.ClientSession(options['KojiHubURL'], opts=opts)

  

      environ['koji.currentLogin'] = _getUserCookie(environ)

      if environ['koji.currentLogin']:

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

3 years ago

pretty please pagure-ci rebuild

3 years ago

pretty please pagure-ci rebuild

3 years ago

rebased onto 531b37c

3 years ago

The previous code used get(), and the new code just refers to the dict key directly. Will this end up with a KeyError if KojiHubCA is not defined in options?

It is option which has default in wsgi_publisher.py so it should be never non-existent.

It is option which has default in wsgi_publisher.py so it should be never non-existent.

Ok, thanks for explaining.

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

3 years ago

Commit ed04738 fixes this pull-request

Pull-Request has been merged by tkopecek

3 years ago