Merge pull request #47515 from rallytime/bp-47503

Back-port #47503 to 2018.3
This commit is contained in:
Nicole Thomas 2018-05-08 09:32:02 -04:00 committed by GitHub
commit bf79acfbc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,7 +225,7 @@ def _switch(name, # pylint: disable=C0103
if os.path.exists(config):
with salt.utils.files.fopen(config, 'r') as ifile:
for line in ifile:
line = salt.utils.stringutils.to_unicode(line).rstrip('\n')
line = salt.utils.stringutils.to_unicode(line)
if not line.startswith('{0}='.format(rcvar)):
nlines.append(line)
continue