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

Ship it!



ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py
 (line 187)
<https://reviews.apache.org/r/40352/#comment165929>

    I don't think you need to encapsulate the `format_exc` in a `str()` as it's 
already a string:
    
    traceback.format_exc([limit])
    This is like print_exc(limit) but returns a string instead of printing to a 
file.


- Jonathan Hurley


On Nov. 18, 2015, 9:12 a.m., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40352/
> -----------------------------------------------------------
> 
> (Updated Nov. 18, 2015, 9:12 a.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-13905
>     https://issues.apache.org/jira/browse/AMBARI-13905
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In general, the script alerts need logging to cover error scenarios.
> For example:
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
>       json_response = json.loads(stdout)
>     except Exception, exception:
>       return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
> If the response is not a valid JSON Ambari should log the content rather than 
> just reporting that json could not be parsed through the alert text.
> Similar enhancements may be needed in several script based alerts. At least, 
> lets cover all the three alert scripts that are in HIVE.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64 
>   
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py
>  548a838 
>   
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
>  bfc518f 
>   
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py
>  be72327 
>   
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py
>  7f23d31 
>   
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
>  8d8bd58 
>   
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
>  2c44b36 
>   
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
>  912969a 
>   
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py
>  11f29fd 
> 
> Diff: https://reviews.apache.org/r/40352/diff/
> 
> 
> Testing
> -------
> 
> Unit tests passed
> 
> 
> Thanks,
> 
> Dmytro Sen
> 
>

Reply via email to