From: Wido den Hollander Date: Mon, 26 Jun 2017 09:50:50 +0000 (+0200) Subject: rest api: Set application variable when not executed as __main__ X-Git-Tag: v12.1.1~262^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3f0428ac3aee18813c4b182faab4a094744eb435;p=ceph-ci.git 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 --- 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