From 309a6f93f878fc96951902fc47d45a30ef5f8d71 Mon Sep 17 00:00:00 2001 From: Christopher Baklid Date: Wed, 23 May 2018 22:38:20 +0200 Subject: POC completed --- config.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 config.py (limited to 'config.py') 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 -- cgit v1.2.3