mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Improves lineinfile's error checking
Line in file would raise a TypeError exception if the 'line' key was in params, but its value was None.
This commit is contained in:
parent
266d2008d8
commit
64fa95ca11
1 changed files with 1 additions and 1 deletions
|
@ -305,7 +305,7 @@ def main():
|
|||
module.fail_json(rc=256, msg='Destination %s is a directory !' % dest)
|
||||
|
||||
if params['state'] == 'present':
|
||||
if 'line' not in params:
|
||||
if params.get('line') is None:
|
||||
module.fail_json(msg='line= is required with state=present')
|
||||
|
||||
# Deal with the insertafter default value manually, to avoid errors
|
||||
|
|
Loading…
Reference in a new issue