python3: replace execfile by exec function (#40570)

This commit is contained in:
Nicolas Roche 2020-03-09 16:49:28 +01:00
parent e43606f823
commit 45c0a44e89
3 changed files with 6 additions and 6 deletions

View File

@ -175,4 +175,4 @@ BIJOE_CACHE = True
PAGE_LENGTH = 20
if 'BIJOE_SETTINGS_FILE' in os.environ:
execfile(os.environ['BIJOE_SETTINGS_FILE'])
exec(open(os.environ['BIJOE_SETTINGS_FILE']).read())

View File

@ -1,4 +1,4 @@
# This file is sourced by "execfile" from bijoe.settings
# This file is sourced by "exec" from bijoe.settings
import os
@ -9,7 +9,7 @@ PROJECT_NAME = 'bijoe'
#
INSTALLED_APPS = INSTALLED_APPS + ('mellon',)
execfile('/usr/lib/hobo/debian_config_common.py')
exec(open('/usr/lib/hobo/debian_config_common.py').read())
# SAML2 authentication
AUTHENTICATION_BACKENDS = ('mellon.backends.SAMLBackend',)
@ -32,7 +32,7 @@ INSTALLED_APPS = ('bijoe.hobo_agent',) + INSTALLED_APPS
#
# local settings
#
execfile(os.path.join(ETC_DIR, 'settings.py'))
exec(open(os.path.join(ETC_DIR, 'settings.py')).read())
# run additional settings snippets
execfile('/usr/lib/hobo/debian_config_settings_d.py')
exec(open('/usr/lib/hobo/debian_config_settings_d.py').read())

2
debian/settings.py vendored
View File

@ -9,7 +9,7 @@
# WARNING! Quick-start development settings unsuitable for production!
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# This file is sourced by "execfile" from /usr/lib/bijoe/debian_config.py
# This file is sourced by "exec" from /usr/lib/bijoe/debian_config.py
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False