From f0d935291715742b2e9f71c1b5e1ecbf23d02eff Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Mon, 18 May 2020 18:43:06 +0000
Subject: [PATCH] Replace uwsgi with waitress due to 400 Bad Request issues

---
 run.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/run.py b/run.py
index 7645305..7502587 100755
--- a/run.py
+++ b/run.py
@@ -1,9 +1,11 @@
 #!/usr/bin/env python3
 
 import logging
+import os
 
 import docker_plugin_api.Plugin
 import flask
+import waitress
 
 app = flask.Flask('pyIPAM')
 app.logger.setLevel(logging.DEBUG)
@@ -15,4 +17,7 @@
 app.register_blueprint(lib.IpamDriver.app)
 
 if __name__ == '__main__':
-    app.run(debug=True)
+	if os.environ.get('ENVIRONMENT', 'dev') == 'dev':
+		app.run(debug=True)
+	else:
+		waitress.serve(app, unix_socket='/run/docker/plugins/pyipam.sock', threads=1)

--
Gitblit v1.9.1