ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: AMBARI-5354 Automatic Bootstrap on cento5 fails when no python2.6 is present (anishuk via dsen)
Date Fri, 04 Apr 2014 19:39:48 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e63a05a85 -> c21459200


AMBARI-5354 Automatic Bootstrap on cento5 fails when no python2.6 is present (anishuk via
dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c2145920
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c2145920
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c2145920

Branch: refs/heads/trunk
Commit: c21459200eb16efdff5a253d31bc7375791b4042
Parents: e63a05a
Author: Dmitry Sen <dsen@hortonworks.com>
Authored: Fri Apr 4 22:39:42 2014 +0300
Committer: Dmitry Sen <dsen@hortonworks.com>
Committed: Fri Apr 4 22:39:42 2014 +0300

----------------------------------------------------------------------
 .../src/main/python/common_functions/os_check.py | 19 +++++++++++++++----
 ambari-server/src/main/python/os_check_type.py   |  2 +-
 2 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2145920/ambari-common/src/main/python/common_functions/os_check.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/common_functions/os_check.py b/ambari-common/src/main/python/common_functions/os_check.py
index 982d1d0..1256a07 100644
--- a/ambari-common/src/main/python/common_functions/os_check.py
+++ b/ambari-common/src/main/python/common_functions/os_check.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.6
+#!/usr/bin/env python
 
 '''
 Licensed to the Apache Software Foundation (ASF) under one
@@ -19,9 +19,20 @@ limitations under the License.
 '''
 
 import os
+import sys
 import platform
 
 
+def linux_distribution():
+  PYTHON_VER = sys.version_info[0] * 10 + sys.version_info[1]
+
+  if PYTHON_VER < 26:
+    linux_distribution = platform.dist()
+  else:
+    linux_distribution = platform.linux_distribution()
+
+  return linux_distribution
+
 class OSCheck:
 
   @staticmethod
@@ -36,7 +47,7 @@ class OSCheck:
     """
     # Read content from /etc/*-release file
     # Full release name
-    dist = platform.linux_distribution()
+    dist = linux_distribution()
     operatingSystem = dist[0].lower()
 
     # special cases
@@ -81,7 +92,7 @@ class OSCheck:
     """
     # Read content from /etc/*-release file
     # Full release name
-    dist = platform.linux_distribution()
+    dist = linux_distribution()
     dist = dist[1]
 
     if dist:
@@ -105,7 +116,7 @@ class OSCheck:
 
     In case cannot detect raises exception.
     """
-    dist = platform.linux_distribution()
+    dist = linux_distribution()
     dist = dist[2].lower()
 
     if dist:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2145920/ambari-server/src/main/python/os_check_type.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/os_check_type.py b/ambari-server/src/main/python/os_check_type.py
index ce3d9da..f1823e3 100644
--- a/ambari-server/src/main/python/os_check_type.py
+++ b/ambari-server/src/main/python/os_check_type.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.6
+#!/usr/bin/env python
 
 '''
 Licensed to the Apache Software Foundation (ASF) under one


Mime
View raw message