Simplify merging of secret.ini and make it optional.
This commit is contained in:
parent
b31d7cd745
commit
724d580326
|
@ -1,4 +1,3 @@
|
|||
[tahrir]
|
||||
use = egg:tahrir
|
||||
session.secret = "boythisissecret"
|
||||
authnsecret = "verysecret"
|
||||
|
|
|
@ -51,17 +51,11 @@ def main(global_config, **settings):
|
|||
parser = ConfigParser.ConfigParser()
|
||||
parser.read(secret_path)
|
||||
secret_config = dict(parser.items("tahrir"))
|
||||
settings.update(secret_config)
|
||||
except Exception as e:
|
||||
# TODO: There is a better way to log this message than print.
|
||||
print 'Failed to load secret.ini. Reason: %r' % str(e)
|
||||
exit(0)
|
||||
|
||||
settings.update({
|
||||
'session.secret':
|
||||
secret_config['session.secret'],
|
||||
'authnsecret':
|
||||
secret_config['authnsecret'],
|
||||
})
|
||||
|
||||
authn_policy = AuthTktAuthenticationPolicy(
|
||||
secret=settings['authnsecret'],
|
||||
|
|
Loading…
Reference in New Issue