From 3410a6165af199992c0b06eaf603dd0dde72c4b0 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 15 Jan 2019 15:56:21 -0700 Subject: Add distro_python3 option As we add support for python3 on RHEL based systems, we need to add a flag to key off of in the Dockerfiles to swap out the python3 package names. This change adds a distro_python3 configuration option that can be defined to force python3 or python2 package names. If this option is not provided, we set this to True for RHEL 8 based distros and false for other distros. Change-Id: I4028991bad92c0e8e21066cc4173c06ce5eba393 Related-Blueprint: python3-support --- kolla/image/build.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kolla/image') diff --git a/kolla/image/build.py b/kolla/image/build.py index 9ab3f68df..6cb1cb2da 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -689,6 +689,14 @@ class KollaWorker(object): deb_base = ['ubuntu', 'debian'] deb_type = ['source', 'binary'] + if self.conf.distro_python3 is not None: + self.distro_python3 = self.conf.distro_python3 + elif self.base in rh_base and self.base_tag in ['8']: + # RHEL 8+ is python3 + self.distro_python3 = True + else: + self.distro_python3 = False + if not ((self.base in rh_base and self.install_type in rh_type) or (self.base in deb_base and self.install_type in deb_type)): raise exception.KollaMismatchBaseTypeException( @@ -888,6 +896,7 @@ class KollaWorker(object): 'kolla_version': kolla_version, 'image_name': image_name, 'users': self.get_users(), + 'distro_python3': self.distro_python3, 'rpm_setup': self.rpm_setup, 'build_date': build_date} env = jinja2.Environment( # nosec: not used to render HTML -- cgit v1.2.3