From cd07305c08dd8263b70e294e7b32526ca3d92025 Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Tue, 28 Apr 2020 16:37:35 -0400 Subject: [PATCH 1/2] Set SDB_NOTIFY_HOST on non-docker OS X --- awx/settings/development.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/settings/development.py b/awx/settings/development.py index ac2a9fde94..23f148e7b1 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -10,6 +10,7 @@ import copy import sys import traceback import uuid +import platform # Centos-7 doesn't include the svg mime type # /usr/lib64/python/mimetypes.py @@ -176,7 +177,10 @@ CLUSTER_HOST_ID = socket.gethostname() if 'Docker Desktop' in os.getenv('OS', ''): os.environ['SDB_NOTIFY_HOST'] = 'docker.for.mac.host.internal' else: - os.environ['SDB_NOTIFY_HOST'] = os.popen('ip route').read().split(' ')[2] + if platform.system() == 'Darwin': + os.environ['SDB_NOTIFY_HOST'] = os.popen('ipconfig getifaddr en0').read().strip() + else: + os.environ['SDB_NOTIFY_HOST'] = os.popen('ip route').read().split(' ')[2] WEBSOCKET_ORIGIN_WHITELIST = ['https://localhost:8043', 'https://localhost:3000'] AWX_CALLBACK_PROFILE = True From 3a6a7c100ab095e84caa0ad02adb84684ec0b008 Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Tue, 28 Apr 2020 16:47:08 -0400 Subject: [PATCH 2/2] Going for a more generic 'just pass' option --- awx/settings/development.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/awx/settings/development.py b/awx/settings/development.py index 23f148e7b1..d8e20e9847 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -10,7 +10,6 @@ import copy import sys import traceback import uuid -import platform # Centos-7 doesn't include the svg mime type # /usr/lib64/python/mimetypes.py @@ -177,10 +176,10 @@ CLUSTER_HOST_ID = socket.gethostname() if 'Docker Desktop' in os.getenv('OS', ''): os.environ['SDB_NOTIFY_HOST'] = 'docker.for.mac.host.internal' else: - if platform.system() == 'Darwin': - os.environ['SDB_NOTIFY_HOST'] = os.popen('ipconfig getifaddr en0').read().strip() - else: + try: os.environ['SDB_NOTIFY_HOST'] = os.popen('ip route').read().split(' ')[2] + except Exception: + pass WEBSOCKET_ORIGIN_WHITELIST = ['https://localhost:8043', 'https://localhost:3000'] AWX_CALLBACK_PROFILE = True