From 6a883f1cd62c989dc26b765a56ecab77f2dfbca9 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 4 Jun 2021 10:21:12 -0400 Subject: [PATCH] better message and timeout warning when timeout (#74885) * better message and timeout warning when timeout --- changelogs/fragments/better_timeout_msg.yml | 2 ++ lib/ansible/module_utils/facts/hardware/linux.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/better_timeout_msg.yml diff --git a/changelogs/fragments/better_timeout_msg.yml b/changelogs/fragments/better_timeout_msg.yml new file mode 100644 index 00000000000..3b937150100 --- /dev/null +++ b/changelogs/fragments/better_timeout_msg.yml @@ -0,0 +1,2 @@ +bugfixes: + - gather_facts, improved message on timeout. diff --git a/lib/ansible/module_utils/facts/hardware/linux.py b/lib/ansible/module_utils/facts/hardware/linux.py index 1beb9a5cde9..0fc888a93ad 100644 --- a/lib/ansible/module_utils/facts/hardware/linux.py +++ b/lib/ansible/module_utils/facts/hardware/linux.py @@ -581,7 +581,8 @@ class LinuxHardware(Hardware): elif time.time() > results[mount]['timelimit']: done = True - results[mount]['info']['note'] = 'Could not get extra information: %s.' % (to_text(res.get())) + self.module.warn("Timeout exceeded when getting mount info for %s" % mount) + results[mount]['info']['note'] = 'Could not get extra information due to timeout' except Exception as e: import traceback done = True