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

Review request for Ambari, Laszlo Puskas, Oliver Szabo, Sumit Mohanty, and 
Srimanth Gunturi.


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


Repository: ambari


Description
-------

In the case of having a syntax error in a stack_advisor.py, it is swallowed and 
call is returned with exit code 0.
This means that configuration changes before the syntax error are applied, but 
changes after the syntax error are skipped.
As a result the browser call returns with the response of 200 OK and 
configuration that looks to be correct, but it might be incorrect, since parts 
of the stack advisor is skipped.

The fix replaces the general exception to IOError. So only IO related 
exceptions are swallowed, for example: FileNotFound. This should be swallowed, 
because if a stack_advisor.py file is missing, but no other file would use it, 
then it works correctly. (consider the case when the latest stack version has 
no stack_advisor.py file, since the previous version covers all the 
functionality that is needed for the latest version)

UI will not warn the user if there is an error, so users need to review if 
there is an error in the recommendations.


Diffs
-----

  ambari-server/src/main/resources/scripts/stack_advisor.py cdd9acb 

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


Testing
-------

Manual testing of:
- creating syntax error
- creating semantical error (incorrect array indexing)
- throwing an exception
- removing a stack advisor file that is used in the next version (this leads to 
an error, correctly)
- removing a stack advisor file that is NOT used in the next version (no error, 
correctly)


Thanks,

Daniel Gergely

Reply via email to