mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 12:51:25 -07:00
crypttab: Trim trailing newlines (#51594)
Having a comment or an empty line in /etc/crypttab results in an additional empty line being added, because the newline that is part of the line being read is getting re-injected in addition to the newline used to concatenate the lines. Signed-off-by: Sven Wegener <sven.wegener@inovex.de>
This commit is contained in:
parent
8724c0deda
commit
a966662e9a
1 changed files with 1 additions and 0 deletions
|
@ -218,6 +218,7 @@ class Line(object):
|
||||||
self.opts = Options(opts)
|
self.opts = Options(opts)
|
||||||
|
|
||||||
if line is not None:
|
if line is not None:
|
||||||
|
self.line = self.line.rstrip('\n')
|
||||||
if self._line_valid(line):
|
if self._line_valid(line):
|
||||||
self.name, backing_device, password, opts = self._split_line(line)
|
self.name, backing_device, password, opts = self._split_line(line)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue