mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix _get_file_contents to return bytes and checking that a different file exists than it opens
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user