This is an automated email from the ASF dual-hosted git repository.

iwasakims pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 5355eac39 BIGTOP-4100: Set default python to python3 in bigtop deploy 
(#1263)
5355eac39 is described below

commit 5355eac396d70e1c170195851ccbd9e3d62637ad
Author: jialiang <[email protected]>
AuthorDate: Wed May 22 13:53:10 2024 +0800

    BIGTOP-4100: Set default python to python3 in bigtop deploy (#1263)
---
 bigtop-deploy/puppet/manifests/python.pp | 52 ++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 9 deletions(-)

diff --git a/bigtop-deploy/puppet/manifests/python.pp 
b/bigtop-deploy/puppet/manifests/python.pp
index 8ddafcff1..076c3f4ad 100644
--- a/bigtop-deploy/puppet/manifests/python.pp
+++ b/bigtop-deploy/puppet/manifests/python.pp
@@ -14,16 +14,50 @@
 # limitations under the License.
 
 class python {
-    if (($operatingsystem == 'Ubuntu' and 0 <= 
versioncmp($operatingsystemmajrelease, '22.04'))) {
-        file { '/usr/bin/python':
-          ensure => 'link',
-          target => '/usr/bin/python2',
+    case $operatingsystem {
+        /(?i:(centos|fedora|redhat|rocky))/: {
+            package { 'python3-devel':
+              ensure => 'present',
+            }
+            if ($operatingsystem != 'Fedora') {
+                case $operatingsystemmajrelease {
+                    '9': {
+                        package { 'python-unversioned-command':
+                          ensure => 'present',
+                        }
+                    }
+                    '8': {
+                        exec { 'set-python3':
+                          command => '/usr/sbin/update-alternatives --set 
python /usr/bin/python3',
+                          unless  => "/usr/sbin/update-alternatives --display 
python | grep  'link currently points to /usr/bin/python3'",
+                          path    => ['/bin', '/usr/bin', '/sbin', 
'/usr/sbin'],
+                        }
+                    }
+                }
+            }else {
+                package { 'python-unversioned-command':
+                  ensure => 'present',
+                }
+            }
         }
-    }
-    
-    if ($operatingsystem == 'openEuler') {
-        package { 'python3-unversioned-command':
-          ensure => 'present'
+
+        /(Ubuntu|Debian)/: {
+            package { 'python3-dev':
+              ensure => 'present',
+            }
+            package { 'python-is-python3':
+              ensure => 'present',
+            }
+        }
+
+        /openEuler/: {
+            package { 'python3-devel':
+              ensure => 'present',
+            }
+            package { 'python3-unversioned-command':
+              ensure => 'present',
+            }
         }
     }
 }
+

Reply via email to