Repository: ambari Updated Branches: refs/heads/trunk 872d3c76b -> b1ad9ea73
AMBARI-4917 when pushing a large config file (like log4j), don't show all content in log (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b1ad9ea7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b1ad9ea7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b1ad9ea7 Branch: refs/heads/trunk Commit: b1ad9ea73e47167e64380fb8fdf08a3738836d3c Parents: 872d3c7 Author: Dmitry Sen <[email protected]> Authored: Mon Mar 3 17:34:50 2014 +0200 Committer: Dmitry Sen <[email protected]> Committed: Mon Mar 3 17:49:19 2014 +0200 ---------------------------------------------------------------------- ambari-agent/src/main/python/resource_management/core/logger.py | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b1ad9ea7/ambari-agent/src/main/python/resource_management/core/logger.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/resource_management/core/logger.py b/ambari-agent/src/main/python/resource_management/core/logger.py index a22cd86..3caa78b 100644 --- a/ambari-agent/src/main/python/resource_management/core/logger.py +++ b/ambari-agent/src/main/python/resource_management/core/logger.py @@ -58,11 +58,15 @@ class Logger: @staticmethod def _get_resource_repr(resource): + MESSAGE_MAX_LEN = 256 arguments_str = "" for x,y in resource.arguments.iteritems(): # strip unicode 'u' sign if isinstance(y, unicode): + # don't show long messages + if len(y) > MESSAGE_MAX_LEN: + y = '...' val = repr(y).lstrip('u') # don't show dicts of configurations # usually too long
