diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-05-08 07:16:50 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-05-08 07:16:50 -0500 |
commit | a1eb1f6051300e5d3ce9d1f32d28a25a567e73d8 (patch) | |
tree | a5c7f4d2559f118c7730df7f7805f67be95987a3 /mediagoblin/app.py | |
parent | 0ce26c370c30ec2fbaebba79b1d946d91ce8e96f (diff) | |
download | mediagoblin-a1eb1f6051300e5d3ce9d1f32d28a25a567e73d8.tar.lz mediagoblin-a1eb1f6051300e5d3ce9d1f32d28a25a567e73d8.tar.xz mediagoblin-a1eb1f6051300e5d3ce9d1f32d28a25a567e73d8.zip |
Only convert db port if it's there and use asint to do it (better errors if failing)
Diffstat (limited to 'mediagoblin/app.py')
-rw-r--r-- | mediagoblin/app.py | 6 |
1 files changed, 4 insertions, 2 deletions
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) |