diff options
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 | 
