summaryrefslogtreecommitdiffstats
path: root/.local/bin/keystone-wsgi-admin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/keystone-wsgi-admin')
-rwxr-xr-x.local/bin/keystone-wsgi-admin53
1 files changed, 53 insertions, 0 deletions
diff --git a/.local/bin/keystone-wsgi-admin b/.local/bin/keystone-wsgi-admin
new file mode 100755
index 0000000..f14cfcb
--- /dev/null
+++ b/.local/bin/keystone-wsgi-admin
@@ -0,0 +1,53 @@
+#!/usr/local/bin/python3.8
+#PBR Generated from 'wsgi_scripts'
+
+import threading
+
+from keystone.server.wsgi import initialize_admin_application
+
+if __name__ == "__main__":
+ import argparse
+ import socket
+ import sys
+ import wsgiref.simple_server as wss
+
+ parser = argparse.ArgumentParser(
+ description=initialize_admin_application.__doc__,
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ usage='%(prog)s [-h] [--port PORT] [--host IP] -- [passed options]')
+ parser.add_argument('--port', '-p', type=int, default=8000,
+ help='TCP port to listen on')
+ parser.add_argument('--host', '-b', default='',
+ help='IP to bind the server to')
+ parser.add_argument('args',
+ nargs=argparse.REMAINDER,
+ metavar='-- [passed options]',
+ help="'--' is the separator of the arguments used "
+ "to start the WSGI server and the arguments passed "
+ "to the WSGI application.")
+ args = parser.parse_args()
+ if args.args:
+ if args.args[0] == '--':
+ args.args.pop(0)
+ else:
+ parser.error("unrecognized arguments: %s" % ' '.join(args.args))
+ sys.argv[1:] = args.args
+ server = wss.make_server(args.host, args.port, initialize_admin_application())
+
+ print("*" * 80)
+ print("STARTING test server keystone.server.wsgi.initialize_admin_application")
+ url = "http://%s:%d/" % (server.server_name, server.server_port)
+ print("Available at %s" % url)
+ print("DANGER! For testing only, do not use in production")
+ print("*" * 80)
+ sys.stdout.flush()
+
+ server.serve_forever()
+else:
+ application = None
+ app_lock = threading.Lock()
+
+ with app_lock:
+ if application is None:
+ application = initialize_admin_application()
+