mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make file hardlink error message reasonble
When we hard-link a file, and the link path already exists, give the link path in the error message instead of the source
This commit is contained in:
parent
0d8104b8b7
commit
06963c7826
1 changed files with 1 additions and 1 deletions
|
@ -206,7 +206,7 @@ def main():
|
||||||
# refuse to replace a directory that has files in it
|
# refuse to replace a directory that has files in it
|
||||||
module.fail_json(path=path, msg='the directory %s is not empty, refusing to convert it' % path)
|
module.fail_json(path=path, msg='the directory %s is not empty, refusing to convert it' % path)
|
||||||
elif prev_state in ['file', 'hard'] and not force:
|
elif prev_state in ['file', 'hard'] and not force:
|
||||||
module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, src))
|
module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, path))
|
||||||
|
|
||||||
if prev_state == 'absent':
|
if prev_state == 'absent':
|
||||||
changed = True
|
changed = True
|
||||||
|
|
Loading…
Reference in a new issue