From a1eb1f6051300e5d3ce9d1f32d28a25a567e73d8 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 8 May 2011 07:16:50 -0500 Subject: Only convert db port if it's there and use asint to do it (better errors if failing) --- mediagoblin/app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mediagoblin/app.py') diff --git a/mediagoblin/app.py b/mediagoblin/app.py index 5c094f38..913e530e 100644 --- a/mediagoblin/app.py +++ b/mediagoblin/app.py @@ -18,7 +18,7 @@ import urllib import routes import mongokit -from paste.deploy.converters import asbool +from paste.deploy.converters import asint from webob import Request, exc from mediagoblin import routing, util, models, storage, staticdirect @@ -114,7 +114,9 @@ class MediaGoblinApp(object): def paste_app_factory(global_config, **app_config): # Get the database connection - port = int(app_config.get('db_port')) + port = app_config.get('db_port') + if port: + port = asint(port) connection = mongokit.Connection( app_config.get('db_host'), port) -- cgit v1.2.3