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:
parent
8ddb81a36f
commit
5195536bd8
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
|
||||
import base64
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
|
@ -560,7 +561,7 @@ class JenkinsPlugin(object):
|
|||
|
||||
# Open the updates file
|
||||
try:
|
||||
f = open(updates_file, encoding='utf-8')
|
||||
f = io.open(updates_file, encoding='utf-8')
|
||||
except IOError as e:
|
||||
self.module.fail_json(
|
||||
msg="Cannot open temporal updates file.",
|
||||
|
|
Loading…
Reference in a new issue