mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
Use a less hacky way to determine if we're running inside Docker.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import socket
|
||||
import os
|
||||
|
||||
config = {
|
||||
# Just for dev.
|
||||
@@ -37,9 +37,8 @@ config = {
|
||||
}
|
||||
|
||||
# Try to figure out if we're running inside a docker-compose container
|
||||
fqdn = socket.getfqdn()
|
||||
# If we are, then fqdn is something like '4c62a35c9f9c'
|
||||
if fqdn.isalnum() and len(fqdn) == 12:
|
||||
# http://stackoverflow.com/questions/20010199
|
||||
if os.path.exists('/.dockerenv'):
|
||||
config['endpoints']['relay_outbound'] = ["tcp://fedmsg-relay:2001"]
|
||||
config['relay_inbound'] = ["tcp://fedmsg-relay:2003"]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user