Permalink
Browse files

When pid-path is not given use a sensible default, the current direct…

…ory.
  • Loading branch information...
brosner committed Jul 11, 2008
1 parent dbd118a commit 0b4686c04234362caf9a35c76bd32d590c0d4f8e
Showing with 6 additions and 2 deletions.
  1. +6 −2 bosnowsgi.py
View
@@ -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:

0 comments on commit 0b4686c

Please sign in to comment.