From f27575934e058f00fe3db5ce51d0a0bc98f8ec3c Mon Sep 17 00:00:00 2001 From: quidame Date: Fri, 11 Jun 2021 22:14:41 +0200 Subject: [PATCH] include LockTimeout message into the fail_json's one --- plugins/modules/mount.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/modules/mount.py b/plugins/modules/mount.py index 475555b..001c524 100644 --- a/plugins/modules/mount.py +++ b/plugins/modules/mount.py @@ -766,7 +766,7 @@ def main(): lock_timeout = 2 lock_tempdir = '/tmp' - lock_message = 'another instance of the module holds the %s lock' % os.path.basename(args['fstab']) + lock_message = 'another instance of the module holds the %s lock: timeout (%s)' _fstab = FileLock() try: @@ -872,8 +872,8 @@ def main(): else: module.fail_json(msg='Unexpected position reached') - except LockTimeout: - module.fail_json(msg=lock_message) + except LockTimeout as e: + module.fail_json(msg=lock_message % (os.path.basename(args['fstab']), to_native(e))) # If the managed node is Solaris, convert the boot value type to Boolean # to match the type of return value with the module argument.