This is an automated email from the ASF dual-hosted git repository.
wuzhiguo pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new fa5875564a AMBARI-25156: /var/log/messages gets filled with unhandled
Python exception (#3499)
fa5875564a is described below
commit fa5875564afd72fa9554d5465904f283c156f55e
Author: Zhiguo Wu <[email protected]>
AuthorDate: Wed Nov 16 10:53:30 2022 +0800
AMBARI-25156: /var/log/messages gets filled with unhandled Python exception
(#3499)
---
.../src/main/python/resource_management/libraries/script/script.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git
a/ambari-common/src/main/python/resource_management/libraries/script/script.py
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index 76893fda9e..a011bad6a5 100644
---
a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -357,6 +357,10 @@ class Script(object):
if not self.is_hook():
self.execute_prefix_function(self.command_name, 'post', env)
+ # catch this to avoid unhandled exception logs in /var/log/messages
+ except (ComponentIsNotRunning, ClientComponentHasNoStatus), e:
+ traceback.print_exc()
+ sys.exit(1)
except Fail as ex:
ex.pre_raise()
raise
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]