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.2~1^2~25^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15910%2Fhead;p=ceph.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 6864028d365a..d185a8041ef9 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