mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-25 19:52:12 +01:00
- minor cleanup
This commit is contained in:
parent
739961adfe
commit
17a840deac
10
osc/conf.py
10
osc/conf.py
@ -73,7 +73,6 @@ DEFAULTS = { 'apiurl': 'https://api.opensuse.org',
|
|||||||
'build-memory' : '',# required for VM builds
|
'build-memory' : '',# required for VM builds
|
||||||
'build-swap' : '', # optional for VM builds
|
'build-swap' : '', # optional for VM builds
|
||||||
|
|
||||||
'sslcertck': '1',
|
|
||||||
'debug': '0',
|
'debug': '0',
|
||||||
'http_debug': '0',
|
'http_debug': '0',
|
||||||
'traceback': '0',
|
'traceback': '0',
|
||||||
@ -307,7 +306,7 @@ def init_basicauth(config):
|
|||||||
import os
|
import os
|
||||||
import cookielib
|
import cookielib
|
||||||
|
|
||||||
if config['api_host_options'][config['apiurl']]['sslcertck'] != '0':
|
if config['api_host_options'][config['apiurl']]['sslcertck']:
|
||||||
try:
|
try:
|
||||||
from M2Crypto import m2urllib2, SSL
|
from M2Crypto import m2urllib2, SSL
|
||||||
except:
|
except:
|
||||||
@ -349,7 +348,7 @@ def init_basicauth(config):
|
|||||||
cookiejar = cookielib.CookieJar()
|
cookiejar = cookielib.CookieJar()
|
||||||
|
|
||||||
|
|
||||||
if config['api_host_options'][config['apiurl']]['sslcertck'] != '0':
|
if config['api_host_options'][config['apiurl']]['sslcertck']:
|
||||||
cafile = capath = None
|
cafile = capath = None
|
||||||
if 'capath' in config['api_host_options'][config['apiurl']]:
|
if 'capath' in config['api_host_options'][config['apiurl']]:
|
||||||
capath = config['api_host_options'][config['apiurl']]['capath']
|
capath = config['api_host_options'][config['apiurl']]['capath']
|
||||||
@ -626,10 +625,13 @@ def get_config(override_conffile = None,
|
|||||||
optional = ('email', 'sslcertck', 'cafile', 'capath')
|
optional = ('email', 'sslcertck', 'cafile', 'capath')
|
||||||
for key in optional:
|
for key in optional:
|
||||||
if cp.has_option(url, key):
|
if cp.has_option(url, key):
|
||||||
|
if key == 'sslcertck':
|
||||||
|
api_host_options[apiurl][key] = cp.getboolean(url, key)
|
||||||
|
else:
|
||||||
api_host_options[apiurl][key] = cp.get(url, key)
|
api_host_options[apiurl][key] = cp.get(url, key)
|
||||||
|
|
||||||
if not 'sslcertck' in api_host_options[apiurl]:
|
if not 'sslcertck' in api_host_options[apiurl]:
|
||||||
api_host_options[apiurl]['sslcertck'] = 1
|
api_host_options[apiurl]['sslcertck'] = True
|
||||||
|
|
||||||
# add the auth data we collected to the config dict
|
# add the auth data we collected to the config dict
|
||||||
config['api_host_options'] = api_host_options
|
config['api_host_options'] = api_host_options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user