From bafe59d6c525e3ed07748493f5f83410034e34bb Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Thu, 23 Aug 2018 11:48:41 +0800 Subject: [PATCH] Python 3 compatibility: replace execfile to exec(open(f).read(),filepath,'exec') Story: 2003428 Task: 24616 Change-Id: I884d05da184316d8ef2f4f984efac197295513b0 Signed-off-by: Sun Austin --- openstack/python-horizon/centos/files/local_settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openstack/python-horizon/centos/files/local_settings.py b/openstack/python-horizon/centos/files/local_settings.py index 698c063d..7b4ab182 100755 --- a/openstack/python-horizon/centos/files/local_settings.py +++ b/openstack/python-horizon/centos/files/local_settings.py @@ -992,7 +992,10 @@ DEFAULT_THEME = 'titanium' for root, dirs, files in os.walk('/opt/branding/applied'): if 'manifest.py' in files: - execfile(os.path.join(root, 'manifest.py')) + with open(os.path.join(root, 'manifest.py')) as f: + code = compile(f.read(), os.path.join(root, 'manifest.py'), 'exec') + exec(code) + AVAILABLE_THEMES = [ ('default', 'Default', 'themes/default'), ('material', 'Material', 'themes/material'),