mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-05-08 06:13:02 +00:00
mount - add a newline at the end of line in fstab
* Fixes #210 Signed-off-by: Hideki Saito <saito@fgrep.org>
This commit is contained in:
@@ -254,6 +254,10 @@ def _set_mount_save_old(module, args):
|
||||
'%(src)s - %(name)s %(fstype)s %(passno)s %(boot)s %(opts)s\n')
|
||||
|
||||
for line in open(args['fstab'], 'r').readlines():
|
||||
# Append newline if the line in fstab does not finished with newline.
|
||||
if not line.endswith('\n'):
|
||||
line += '\n'
|
||||
|
||||
old_lines.append(line)
|
||||
|
||||
if not line.strip():
|
||||
|
||||
Reference in New Issue
Block a user