mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
Fix _get_file_contents to return bytes and checking that a different file exists than it opens
This commit is contained in:
parent
d83129f0d1
commit
cce06c5a3b
2 changed files with 17 additions and 9 deletions
|
@ -102,7 +102,8 @@ class LookupModule(LookupBase):
|
|||
paramvals['section'] = 'java_properties'
|
||||
|
||||
# Open file using encoding
|
||||
contents, show_data = self._loader._get_file_contents(path, encoding=paramvals['encoding'])
|
||||
contents, show_data = self._loader._get_file_contents(path)
|
||||
contents = to_text(contents, errors='surrogate_or_strict', encoding=paramvals['encoding'])
|
||||
config.write(contents)
|
||||
config.seek(0, os.SEEK_SET)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue