From e5adc226b64a3f4b12855b6aeaaf8aa1f3da0875 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Fri, 7 Feb 2020 10:47:41 -0500 Subject: [PATCH] Set PROFILE_TASKS_TASK_OUTPUT_LIMIT Currently it is set to 0 by default which results in a summary not being printed at the end of the ansible playbook run. It would greatly benefit operators if we printed out the top 20 time consuming tasks at the end of the playbook run. Conflicts: tripleo_common/tests/actions/test_ansible.py Change-Id: I140fe66091d4e7a710f04da15cc93b7e6bf5742c Signed-off-by: Sai Sindhur Malleni (cherry picked from commit ffff7887d4b155781574c582f84f49c242fc2419) --- tripleo_common/actions/ansible.py | 2 +- tripleo_common/tests/actions/test_ansible.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tripleo_common/actions/ansible.py b/tripleo_common/actions/ansible.py index 1dd7d3d35..25d551da4 100644 --- a/tripleo_common/actions/ansible.py +++ b/tripleo_common/actions/ansible.py @@ -395,7 +395,7 @@ class AnsiblePlaybookAction(base.TripleOAction): self.trash_output = self._kwargs_for_run.pop('trash_output', False) self.profile_tasks = self._kwargs_for_run.pop('profile_tasks', True) self.profile_tasks_limit = self._kwargs_for_run.pop( - 'profile_tasks_limit', 0) + 'profile_tasks_limit', 20) self.blacklisted_hostnames = self._kwargs_for_run.pop( 'blacklisted_hostnames', []) self.override_ansible_cfg = self._kwargs_for_run.pop( diff --git a/tripleo_common/tests/actions/test_ansible.py b/tripleo_common/tests/actions/test_ansible.py index 9fd9efe29..04edf7cfb 100644 --- a/tripleo_common/tests/actions/test_ansible.py +++ b/tripleo_common/tests/actions/test_ansible.py @@ -115,7 +115,7 @@ class AnsiblePlaybookActionTest(base.TestCase): 'ANSIBLE_CONFIG': ansible_config_path, 'ANSIBLE_CALLBACK_WHITELIST': 'tripleo,profile_tasks', 'ANSIBLE_STDOUT_CALLBACK': 'tripleo', - 'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '0', + 'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '20', } python_version = sys.version_info.major ansible_playbook_cmd = 'ansible-playbook-{}'.format(python_version) @@ -155,7 +155,7 @@ class AnsiblePlaybookActionTest(base.TestCase): 'ANSIBLE_CONFIG': ansible_config_path, 'ANSIBLE_CALLBACK_WHITELIST': 'tripleo,profile_tasks', 'ANSIBLE_STDOUT_CALLBACK': 'tripleo', - 'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '0', + 'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '20', } python_version = sys.version_info.major ansible_playbook_cmd = 'ansible-playbook-{}'.format(python_version) @@ -195,7 +195,7 @@ class AnsiblePlaybookActionTest(base.TestCase): 'ANSIBLE_CONFIG': ansible_config_path, 'ANSIBLE_CALLBACK_WHITELIST': 'tripleo,profile_tasks', 'ANSIBLE_STDOUT_CALLBACK': 'tripleo', - 'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '0', + 'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '20', } python_version = sys.version_info.major ansible_playbook_cmd = 'ansible-playbook-{}'.format(python_version)