diff options
author | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-10-10 20:21:25 +0200 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-10-24 18:03:28 +0200 |
commit | e94243aa74e7a77fb6457e02f6f4201b3f063b96 (patch) | |
tree | b6566bf59769bc0d1e3944fa64bf46b68e33f3d6 | |
parent | 5ea128eca075c19880419c072be36fd761aad4a4 (diff) | |
download | ipsilon-e94243aa74e7a77fb6457e02f6f4201b3f063b96.tar.gz ipsilon-e94243aa74e7a77fb6457e02f6f4201b3f063b96.tar.xz ipsilon-e94243aa74e7a77fb6457e02f6f4201b3f063b96.zip |
Make the template directory configurable
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
-rw-r--r-- | examples/ipsilon.conf | 1 | ||||
-rwxr-xr-x | ipsilon/ipsilon | 6 | ||||
-rw-r--r-- | templates/install/ipsilon.conf | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/examples/ipsilon.conf b/examples/ipsilon.conf index d1755c2..eddde2f 100644 --- a/examples/ipsilon.conf +++ b/examples/ipsilon.conf @@ -1,5 +1,6 @@ [global] debug = True +template_dir = "templates" log.screen = True base.mount = "/idp" diff --git a/ipsilon/ipsilon b/ipsilon/ipsilon index 9700106..681600d 100755 --- a/ipsilon/ipsilon +++ b/ipsilon/ipsilon @@ -60,7 +60,11 @@ admin_config = datastore.load_config() for option in admin_config: cherrypy.config[option] = admin_config[option] -templates = os.path.join(cherrypy.config['base.dir'], 'templates') +template_dir = cherrypy.config.get('template_dir', 'templates') +if template_dir.startswith('/'): + templates = template_dir +else: + templates = os.path.join(cherrypy.config['base.dir'], template_dir) template_env = Environment(loader=FileSystemLoader(templates)) if __name__ == "__main__": diff --git a/templates/install/ipsilon.conf b/templates/install/ipsilon.conf index 99491db..83b9704 100644 --- a/templates/install/ipsilon.conf +++ b/templates/install/ipsilon.conf @@ -1,5 +1,6 @@ [global] debug = ${debugging} +template_dir = "templates" log.screen = ${debugging} base.mount = "/${instance}" |