diff options
author | 2018-05-23 22:38:20 +0200 | |
---|---|---|
committer | 2018-05-23 22:38:20 +0200 | |
commit | 309a6f93f878fc96951902fc47d45a30ef5f8d71 (patch) | |
tree | f788b43a892a93d0f97da73f459a55b43e1ea1a0 /config.py | |
parent | update readme (diff) |
POC completed
Diffstat (limited to 'config.py')
-rw-r--r-- | config.py | 25 |
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 |