From 0b4686c04234362caf9a35c76bd32d590c0d4f8e Mon Sep 17 00:00:00 2001 From: brosner Date: Thu, 10 Jul 2008 22:57:06 -0600 Subject: [PATCH] When pid-path is not given use a sensible default, the current directory. --- bosnowsgi.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bosnowsgi.py b/bosnowsgi.py index f9b7a82..59ccc03 100755 --- a/bosnowsgi.py +++ b/bosnowsgi.py @@ -156,8 +156,12 @@ def main(): server_config = config["servers"][name] except KeyError: sys.exit("no server named '%s'" % name) - params["pidfile"] = os.path.join(os.path.expanduser(config["pid-path"]), - "%s.pid" % name) + pid_path = config.get("pid-path") + if not pid_path: + root_pid_path = "." + else: + root_pid_path = os.path.expanduser(config["pid-path"]) + params["pidfile"] = os.path.join(root_pid_path, "%s.pid" % name) try: server = load_wsgi_server(name, config=server_config, **params) except ImproperlyConfigured, ex: