#2749 web: optional KojiHubCA usage
Merged a year ago by tkopecek. Opened a year 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

a year ago

pretty please pagure-ci rebuild

a year ago

pretty please pagure-ci rebuild

a year ago

rebased onto 531b37c

a year 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

a year ago

Commit ed04738 fixes this pull-request

Pull-Request has been merged by tkopecek

a year ago