Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.6.1
-
None
-
Amazon AMI ( amzn-ami-hvm-2014.03.2.x86_64-ebs (ami-76817c1e) )
Description
Running ambari-server on Amazon AMI fails with the error message shown below.
----------------
[ec2-user@ip-xx-xx-xx-xx ~]$ sudo ambari-server setup
Using python /usr/bin/python2.6
Setup ambari-server
Traceback (most recent call last):
File "/usr/sbin/ambari-server.py", line 53, in <module>
OS_VERSION = OSCheck().get_os_major_version()
File "/usr/lib/python2.6/site-packages/ambari_commons/os_check.py", line 155, in get_os_major_version
return OSCheck.get_os_version().split('.')[0]
File "/usr/lib/python2.6/site-packages/ambari_commons/os_check.py", line 146, in get_os_version
raise Exception("Cannot detect os version. Exiting...")
Exception: Cannot detect os version. Exiting…
----------------
This is affected by the python bug - http://bugs.python.org/issue18872
— FIX —
Change line number 32 in function linux_distribution()
FROM
linux_distribution = platform.linux_distribution()
TO
linux_distribution = platform.linux_distribution(supported_dists=['system'])
– FINAL CODE –
…..
26 def linux_distribution():
27 PYTHON_VER = sys.version_info[0] * 10 + sys.version_info[1]
28
29 if PYTHON_VER < 26:
30 linux_distribution = platform.dist()
31 else:
32 linux_distribution = platform.linux_distribution(supported_dists=['system'])
33
34 return linux_distribution
…..