From 3f0428ac3aee18813c4b182faab4a094744eb435 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Mon, 26 Jun 2017 11:50:50 +0200 Subject: [PATCH] rest api: Set application variable when not executed as __main__ This allows for using this Python file as a WSGI module as it expects a variable called application. Signed-off-by: Wido den Hollander --- src/ceph-rest-api | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ceph-rest-api b/src/ceph-rest-api index 6864028d365..d185a8041ef 100755 --- a/src/ceph-rest-api +++ b/src/ceph-rest-api @@ -49,4 +49,7 @@ if 'pdb.py' in files: app.run(host=app.ceph_addr, port=app.ceph_port, debug=True, use_reloader=False, use_debugger=False) else: - app.run(host=app.ceph_addr, port=app.ceph_port) + if __name__ == '__main__': + app.run(host=app.ceph_addr, port=app.ceph_port) + else: + application = app -- 2.47.3