diff --git a/admin-tools/misc/getCruiseId.py b/admin-tools/misc/getCruiseId.py index 1e30553..2bd3e48 100755 --- a/admin-tools/misc/getCruiseId.py +++ b/admin-tools/misc/getCruiseId.py @@ -28,7 +28,7 @@ from python_sealog.settings import apiServerURL, cruisesAPIPath, headers -# FIXME: Override apiServerURL because we're outside of Docker +# FIXME: Override apiServerURL because we're outside of Docker ("fix" in progress) apiServerURL = "https://localhost/sealog/server" @@ -39,6 +39,11 @@ args = parser.parse_args() + # If the script is being run outside the container, use HTTP instead of HTTPS to contact API server. + if not os.path.exists('/.dockerenv'): + print("Outside Docker container environment, using HTTP API server URL.") + apiServerURL = "http://localhost/sealog/server" + r = requests.get(f'{apiServerURL}/{cruisesAPIPath}', headers=headers) cruises = json.loads(r.text)