mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 15:45:20 +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_timeout = 2
|
||||||
lock_tempdir = '/tmp'
|
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()
|
_fstab = FileLock()
|
||||||
try:
|
try:
|
||||||
|
|
@ -872,8 +872,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
module.fail_json(msg='Unexpected position reached')
|
module.fail_json(msg='Unexpected position reached')
|
||||||
|
|
||||||
except LockTimeout:
|
except LockTimeout as e:
|
||||||
module.fail_json(msg=lock_message)
|
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
|
# If the managed node is Solaris, convert the boot value type to Boolean
|
||||||
# to match the type of return value with the module argument.
|
# to match the type of return value with the module argument.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue