Fix error message given by ansible.module_utils.facts.timeout.timeout (#83945) (#84069)

(cherry picked from commit ee9e6130a7)
pull/84194/head
Sloane Hertel 1 year ago committed by GitHub
parent 9adf0c9ff6
commit d6b5fb6ac8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- Use the requested error message in the ansible.module_utils.facts.timeout timeout function instead of hardcoding one.

@ -48,7 +48,7 @@ def timeout(seconds=None, error_message="Timer expired"):
return res.get(timeout_value) return res.get(timeout_value)
except multiprocessing.TimeoutError: except multiprocessing.TimeoutError:
# This is an ansible.module_utils.common.facts.timeout.TimeoutError # This is an ansible.module_utils.common.facts.timeout.TimeoutError
raise TimeoutError('Timer expired after %s seconds' % timeout_value) raise TimeoutError(f'{error_message} after {timeout_value} seconds')
finally: finally:
pool.terminate() pool.terminate()

Loading…
Cancel
Save