-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31129/
-----------------------------------------------------------

Review request for Ambari and Vitalyi Brodetskyi.


Bugs: AMBARI-9682
    https://issues.apache.org/jira/browse/AMBARI-9682


Repository: ambari


Description
-------

I run ambari-server setup on a machine that has a suspect OS version (testing 
out how well we check OS type).

On ambari-server setup, setup fails with the following:

{code}
[root@8 yum.repos.d]# ambari-server setup -s
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/common_functions/os_check.py", line 
110, in get_os_major_version
    return OSCheck.get_os_version().split('.')[0]
  File "/usr/lib/python2.6/site-packages/common_functions/os_check.py", line 
101, in get_os_version
    raise Exception("Cannot detect os version. Exiting...")
Exception: Cannot detect os version. Exiting...
[root@8 yum.repos.d]# 
{code}

1) Setup should not be dumping the traceback to the user.
2) ambari-server supports a "--verbose" option. If verbose is set, then dump 
the traceback. Otherwise, just print the Exception.
3) All exception handling in setup should be reviewed for this traceback 
scenario
4) This same OS call is made during agent registration. Should avoid tracebacks 
there too.

One scenario to test this failing is when folks use the Amazon Linux AMI.

{code}
[root@8 etc]# more /etc/system-release
Amazon Linux AMI release 2014.03
{code}

And if this is helpful:

{code}
[root@8 etc]# python
Python 2.6.9 (unknown, Mar 28 2014, 00:06:37) 
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform;
>>> platform.dist();
('', '', '')
>>> platform.linux_distribution();
('', '', '')
>>> 
{code}


Diffs
-----

  ambari-server/src/main/python/ambari-server.py 5e51a6d 
  ambari-server/src/test/python/TestAmbariServer.py 62e462f 

Diff: https://reviews.apache.org/r/31129/diff/


Testing
-------

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Ambari Views ...................................... SUCCESS [2.506s]
[INFO] Ambari Server ..................................... SUCCESS [34.331s]
[INFO] Ambari Agent ...................................... SUCCESS [16.743s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.382s
[INFO] Finished at: Tue Feb 17 23:11:13 FET 2015
[INFO] Final Memory: 47M/421M
[INFO] ------------------------------------------------------------------------


Thanks,

Dmitro Lisnichenko

Reply via email to