aboutsummaryrefslogtreecommitdiffstats
path: root/config.py
diff options
context:
space:
mode:
authorGravatar Christopher Baklid <[email protected]>2018-05-23 22:38:20 +0200
committerGravatar Christopher Baklid <[email protected]>2018-05-23 22:38:20 +0200
commit309a6f93f878fc96951902fc47d45a30ef5f8d71 (patch)
treef788b43a892a93d0f97da73f459a55b43e1ea1a0 /config.py
parentupdate readme (diff)
POC completed
Diffstat (limited to 'config.py')
-rw-r--r--config.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/config.py b/config.py
new file mode 100644
index 0000000..cb428fe
--- /dev/null
+++ b/config.py
@@ -0,0 +1,25 @@
+import os
+
+def attempt_automatically_finding_the_ip_of_rmq():
+ try:
+ import docker
+ client = docker.from_env()
+ containers = client.containers.get('snekbox_pdrmq_1')
+ HOST = list(containers.attrs.get('NetworkSettings').get('Networks').values())[0]['IPAddress']
+ return HOST
+ except:
+ return '172.17.0.2'
+
+USERNAME = 'guest'
+PASSWORD = 'guest'
+HOST = os.environ.get('RMQ_HOST', attempt_automatically_finding_the_ip_of_rmq())
+PORT = 5672
+EXCHANGE_TYPE = 'direct'
+
+QUEUE = 'input'
+EXCHANGE = QUEUE
+ROUTING_KEY = QUEUE
+
+RETURN_QUEUE = 'return'
+RETURN_EXCHANGE = RETURN_QUEUE
+RETURN_ROUTING_KEY = RETURN_QUEUE