diff options
author | Simo Sorce <simo@redhat.com> | 2013-12-12 15:03:17 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2013-12-13 21:57:57 -0500 |
commit | 29d8f5eca90bcca199d7ad84f9934f3f24eed906 (patch) | |
tree | b4c5ba4366d18250e23307c73053c77fd1456fe4 | |
parent | e9aa502366c570e2ec7bf9f8630ffbab7984e4dd (diff) | |
download | ipsilon-29d8f5eca90bcca199d7ad84f9934f3f24eed906.tar.gz ipsilon-29d8f5eca90bcca199d7ad84f9934f3f24eed906.tar.xz ipsilon-29d8f5eca90bcca199d7ad84f9934f3f24eed906.zip |
Fix global and app configs
Do not overwrite config settings
- the update() method replaces the global config, we just want to merge
new directives normally
Provide default app settings for quick development
- allow ui/ to be served as static files when run in standalone mode
Signed-off-by: Simo Sorce <simo@redhat.com>
-rwxr-xr-x | src/ipsilon.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ipsilon.py b/src/ipsilon.py index 84a9a31..879de7d 100755 --- a/src/ipsilon.py +++ b/src/ipsilon.py @@ -34,20 +34,26 @@ cherrypy.config.update('ipsilon.conf') plugins = plugin.Plugins(path=cherrypy.config['base.dir']) idp_providers = plugins.get_providers() -cherrypy.config.update({'idp_providers': idp_providers}) +if idp_providers: + cherrypy.config['idp_providers'] = idp_providers datastore = data.Store() admin_config = datastore.get_admin_config() -cherrypy.config.update(admin_config) +for option in admin_config: + cherrypy.config[option] = admin_config[option] templates = os.path.join(cherrypy.config['base.dir'], 'templates') env = Environment(loader=FileSystemLoader(templates)) if __name__ == "__main__": - cherrypy.quickstart(root.Root(env)) + conf = { '/': {'tools.staticdir.root': os.getcwd()}, + '/ui': { 'tools.staticdir.on': True, + 'tools.staticdir.dir': 'ui' } + } + cherrypy.quickstart(root.Root(env), '/', conf) else: - cherrypy.config.update({'environment': 'embedded'}) + cherrypy.config['environment'] = 'embedded' if cherrypy.__version__.startswith('3.0') and cherrypy.engine.state == 0: cherrypy.engine.start(blocking=False) |