diff options
| author | termie <github@anarkystic.com> | 2011-06-20 18:37:51 -0700 |
|---|---|---|
| committer | termie <github@anarkystic.com> | 2011-06-20 18:37:51 -0700 |
| commit | 158dfbac2aa91a8c0287f4398e11bc90f7d84ac0 (patch) | |
| tree | 9ecafa0402ca3479aa9809844e8f5e3f887c4dcd /bin | |
| parent | 419c2cb95f5ce0c515fd8636d90065dfcf784c8c (diff) | |
most bits working
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/keystone | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bin/keystone b/bin/keystone new file mode 100755 index 00000000..a3309f6d --- /dev/null +++ b/bin/keystone @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +import os +import sys + +# If ../../keystone/__init__.py exists, add ../ to Python search path, so that +# it will override what happens to be installed in /usr/(local/)lib/python... +possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), + os.pardir, + os.pardir)) +if os.path.exists(os.path.join(possible_topdir, 'keystonelight', '__init__.py')): + sys.path.insert(0, possible_topdir) + +import logging + +import hflags as flags + +from keystonelight import service +from keystonelight import wsgi + + +FLAGS = flags.FLAGS + +flags.DEFINE_boolean('verbose', True, 'verbose logging') + +if __name__ == '__main__': + args = FLAGS(sys.argv) + if FLAGS.verbose: + logging.getLogger().setLevel(logging.DEBUG) + + public = service.Router() + admin = service.AdminRouter() + + public = service.PostParamsMiddleware(public) + + server = wsgi.Server() + server.start(public, 8080) + server.start(admin, 8081) + server.wait() |
