mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
(cherry picked from commit 5195536bd8
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
6b58e784af
commit
0f0eb53efa
2 changed files with 4 additions and 1 deletions
2
changelogs/fragments/2340-jenkins_plugin-py2.yml
Normal file
2
changelogs/fragments/2340-jenkins_plugin-py2.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "jenkins_plugin - fixes Python 2 compatibility issue (https://github.com/ansible-collections/community.general/pull/2340)."
|
|
@ -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.",
|
||||||
|
|
Loading…
Reference in a new issue