mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
switch to fpread().splitlines(), as per @lorengordon suggestion
This commit is contained in:
parent
634f1dded5
commit
5cb38c8ae0
1 changed files with 2 additions and 4 deletions
|
@ -3518,8 +3518,7 @@ def append(name,
|
|||
text = _validate_str_list(text)
|
||||
|
||||
with salt.utils.fopen(name, 'rb') as fp_:
|
||||
slines = fp_.readlines()
|
||||
slines = [item.rstrip(os.linesep) for item in slines]
|
||||
slines = fp_.read().splitlines()
|
||||
|
||||
append_lines = []
|
||||
try:
|
||||
|
@ -3567,8 +3566,7 @@ def append(name,
|
|||
ret['comment'] = 'File {0} is in correct state'.format(name)
|
||||
|
||||
with salt.utils.fopen(name, 'rb') as fp_:
|
||||
nlines = fp_.readlines()
|
||||
nlines = [item.rstrip(os.linesep) for item in nlines]
|
||||
nlines = fp_.read().splitlines()
|
||||
|
||||
if slines != nlines:
|
||||
if not salt.utils.istextfile(name):
|
||||
|
|
Loading…
Add table
Reference in a new issue