Skip to content

Commit

Permalink
TMP: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Dec 9, 2024
1 parent 0371ce4 commit c978d4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/olympia/core/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ def uwsgi_check(app_configs, **kwargs):
def host_check(app_configs, **kwargs):
"""Check that the host settings are valid."""
errors = []
is_production = (
settings.OLYMPIA_MOUNT is None or settings.OLYMPIA_MOUNT == 'production'
)

# In production, we expect settings.OLYMPIA_UID to be None and so
# set the expected uid to 9500, otherwise we expect the uid
# passed to the environment to be the expected uid.
expected_uid = 9500 if settings.OLYMPIA_UID is None else int(settings.OLYMPIA_UID)
expected_uid = 9500 if is_production else int(settings.OLYMPIA_UID)
actual_uid = os.getuid()

if actual_uid != expected_uid:
Expand All @@ -60,7 +63,7 @@ def host_check(app_configs, **kwargs):
]

# In production we files matching the dockerignore file to be excluded
if settings.OLYMPIA_MOUNT is None or settings.OLYMPIA_MOUNT == 'production':
if is_production:
with open('/data/olympia/.dockerignore', 'r') as f:
dockerignore = f.read()

Expand Down

0 comments on commit c978d4b

Please sign in to comment.