mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 07:35:31 +01:00
include LockTimeout message into the fail_json's one
This commit is contained in:
parent
6181b4d784
commit
f27575934e
1 changed files with 3 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue