1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix Python 2 compatibility issue. (#2340)

This commit is contained in:
Felix Fontein 2021-04-26 06:56:21 +02:00 committed by GitHub
parent 8ddb81a36f
commit 5195536bd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "jenkins_plugin - fixes Python 2 compatibility issue (https://github.com/ansible-collections/community.general/pull/2340)."

View file

@ -276,6 +276,7 @@ from ansible.module_utils.six import text_type, binary_type
from ansible.module_utils._text import to_native from ansible.module_utils._text import to_native
import base64 import base64
import hashlib import hashlib
import io
import json import json
import os import os
import tempfile import tempfile
@ -560,7 +561,7 @@ class JenkinsPlugin(object):
# Open the updates file # Open the updates file
try: try:
f = open(updates_file, encoding='utf-8') f = io.open(updates_file, encoding='utf-8')
except IOError as e: except IOError as e:
self.module.fail_json( self.module.fail_json(
msg="Cannot open temporal updates file.", msg="Cannot open temporal updates file.",