Simplify merging of secret.ini and make it optional.

This commit is contained in:
Ralph Bean 2013-07-01 18:29:11 -04:00
parent b31d7cd745
commit 724d580326
2 changed files with 1 additions and 8 deletions

View File

@ -1,4 +1,3 @@
[tahrir]
use = egg:tahrir
session.secret = "boythisissecret"
authnsecret = "verysecret"

View File

@ -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'],