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/tests/test_build.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'kolla/tests') diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index b721bb237..c6a953003 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -381,6 +381,26 @@ class KollaWorkerTest(base.TestCase): kolla = build.KollaWorker(self.conf) self.assertEqual(2, len(kolla.rpm_setup)) + def test_build_distro_python3(self): + """check distro_python3 conf value is taken""" + self.conf.set_override('distro_python3', True) + kolla = build.KollaWorker(self.conf) + self.assertTrue(kolla.distro_python3) + + def test_build_distro_python3_rhel8(self): + """check distro_python3 true for rhel8""" + self.conf.set_override('base', 'rhel') + self.conf.set_override('base_tag', '8') + kolla = build.KollaWorker(self.conf) + self.assertTrue(kolla.distro_python3) + + def test_build_distro_python3_non_rhel8(self): + """check distro_python3 false for non-rhel8""" + self.conf.set_override('base', 'rhel') + self.conf.set_override('base_tag', '7') + kolla = build.KollaWorker(self.conf) + self.assertFalse(kolla.distro_python3) + def test_pre_defined_exist_profile(self): # default profile include the fake image: image-base self.conf.set_override('profile', ['default']) -- cgit v1.2.3